<template>
    <div class="show-class-stu">
        <div class="container" v-loading="loading">
            <div class="stu-header">
                <el-form label-position="right" :inline="true">
                    <el-form-item class="nine-form-title" prop="name" label="班级名称">
                        <span class="mtitle-color mtitle-font">{{searchParam.data.name || '无'}}</span>
                    </el-form-item>
                    <!-- <el-form-item class="form-title nine-form-title" prop="radio" label="状态">
                        <el-radio-group v-model="searchParam.radio">
                            <el-radio :label="0">全部</el-radio>
                            <el-radio :label="1">未结课</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item class="searchbt">
                        <el-button @click="getTableData">查询</el-button>
                    </el-form-item> -->
                </el-form>
            </div>
            <el-table :data="dataLists.data" border highlight-current-row class="table" ref="table1" :height="tableHeight.value" :header-cell-style="{background: '#f1f1f1', color: '#333'}" >
                <el-table-column label="序号" align="center" width="60"><template #default="scope"><span>{{scope.$index + 1}}</span></template></el-table-column>
                <el-table-column prop="studentId" label="学号" align="center" header-align="center" width="90">
                    <template #default="scope">
                        <el-button v-if="searchParam.data.flag == 0 || searchParam.data.flag == 5" link type="primary" size="small" @click="changgeStuInfo(scope.row)" class="idAddName">{{scope.row.studentId}}</el-button>
                        <span v-else class="idAddName">{{scope.row.studentId}}</span>          
                    </template>
                </el-table-column>
                <el-table-column prop="allName" align="center" header-align="center" label="姓名">
                    <template #default="scope">
                        <el-button link type="primary" @click="studentInfo(scope.row)" class="idAddName">{{scope.row.allName}}</el-button>
                    </template>
                </el-table-column>
                <el-table-column prop="sex" label="性别" align="center" header-align="center" ></el-table-column>
                <el-table-column prop="subjectNames" label="选考科目" align="center" header-align="center" ></el-table-column>
                <el-table-column prop="" header-align="center" align="center" label="当前是否住宿" >
                    <template #default="scope">
                        <span style="cursor: pointer;" v-if="scope.row.ifStay == 0">{{scope.row.ifStayName}}</span>
                        <el-tooltip placement="right" v-if="scope.row.ifStay == 1">
                            <span style="cursor: pointer;">{{scope.row.ifStayName}}</span>
                            <template #content>宿舍地址及宿舍号：<br/>{{scope.row.stayAddress}}</template>
                        </el-tooltip>
                    </template>
                </el-table-column>
                <el-table-column prop="realname" header-align="center" align="center" label="业绩人" > </el-table-column>
                <el-table-column prop="firstJoinClassTime" header-align="center" align="center" label="首次进班日期" ></el-table-column>
                <el-table-column prop="firstJoinClassName" header-align="center" align="center" label="首次进班班级" ></el-table-column>
                <el-table-column prop="" header-align="center" align="center" label="所报课程结束日期" >
                    <template #default="scope">
                        <span v-if="scope.row.ifRed === 1" style="color: red;">{{scope.row.courseEndDate}}</span> 
                        <span v-else>{{scope.row.courseEndDate}}</span>          
                    </template>
                </el-table-column>
                <el-table-column align="left" header-align="center" label="操作" width="320">
                    <template #default="scope">
                        <!-- //（原）班主任班级管理-学生名单跳转时会带flag参数，现（教育-班级管理）flag=0；
                        （原）高考全日制班级查看，现（教务-班级查看） flag = 2;
                        （原）教师班级管理，现（教学-班级管理）--flag = 3；
                        （原）高考全日制班级管理，现（教务-1 班级管理） flag = 4;
                        （原）高考校区教务管理，现（教务-2 教务管理） flag = 5 -->
                        <el-button @click="xueiqngfenxi(scope.row)" link type="primary" v-if="searchParam.data.flag==3" ><el-icon><Edit /></el-icon>学情分析</el-button>
                        <el-button @click="goAchievementHomePage(scope.row)" link type="primary" v-if="searchParam.data.flag==3" size="small" ><el-icon><Edit /></el-icon>成绩首页</el-button>
                        <!-- 新 9-22  -->
                        <!-- <el-button @click="goEnWordSetting(scope.row)" link type="primary" v-if="searchParam.data.flag==3 && ifEnTeacher" size="small" icon="el-icon-notebook-1">背单词</el-button> -->
                        <!-- 新<el-button @click="errfenxi(scope.row)" link type="primary" v-if="searchParam.data.flag==3" icon="el-icon-edit">错因分析</el-button> -->
                        <!-- 新<el-button @click="goSchedule(scope.row)" link type="primary" v-if="showCourse && searchParam.data.flag!=3 && searchParam.data.flag!=0&& searchParam.data.classType!=1" size="small" icon="el-icon-view">课表</el-button>1教学，0行政，行政才显示 -->
                        <el-button @click="toMeetingDetail(scope.row)" v-if="searchParam.data.flag==4 || searchParam.data.flag == 2" link type="primary" size="small"><el-icon><View /></el-icon>例会详情</el-button>
                        <el-button @click="getfenclass(scope.row)" link type="primary" size="small" v-if="searchParam.data.flag==4 || searchParam.data.flag == 2" ><el-icon><View /></el-icon>分班成绩</el-button>
                        <el-button @click="getfenclass(scope.row, 1)" link type="primary" size="small" v-if="searchParam.data.flag==4 || searchParam.data.flag == 2" ><el-icon><View /></el-icon>分班测试成绩</el-button>
                        <el-button @click="goConnect(scope.row)"  v-if="searchParam.data.flag==0 || searchParam.data.flag ==5" link type="primary" size="small"><el-icon><Edit /></el-icon>沟通记录</el-button>
                        <el-button @click="goSixOne(scope.row)" link type="primary" size="small" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5"  ><el-icon><Edit /></el-icon>6+1</el-button>
                        <el-button @click="goStudentType(scope.row)" link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5"  style="margin-left:10px;"><el-icon><Edit /></el-icon>学生类型</el-button>
                        <el-popover id="app" ref="popverRef" placement="bottom" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5 ||searchParam.data.flag==3" trigger="click" width="315" margin-right="60" style="margin-left:10px;">
                            <el-button @click="goSchedule(scope.row)" link type="primary" v-if="searchParam.data.flag==3 || (showCourse && searchParam.data.flag!=3 && searchParam.data.flag!=0&& searchParam.data.classType!=1)" size="small" ><el-icon><Edit /></el-icon>课表</el-button>
                            <!-- <el-button @click="goScoreTestChoose(scope.row)" link type="primary" v-if="searchParam.data.flag==0||searchParam.data.flag==3||searchParam.data.flag==5" size="small" >考试报告</el-button> -->
                            <el-button @click="errfenxi(scope.row)" link type="primary" v-if="searchParam.data.flag==0" ><el-icon><Edit /></el-icon>错因分析</el-button>  
                            <el-button @click="toloosreport(scope.row)" link type="primary"  v-if="searchParam.data.flag==0 || searchParam.data.flag ==5"><el-icon><Edit /></el-icon>失利分析</el-button> 
                            <el-button @click="toTopPlan(scope.row)" link type="primary"  v-if="searchParam.data.flag==0 || searchParam.data.flag ==5"><el-icon><Edit /></el-icon>登顶计划</el-button> 
                            <el-button @click="showScoreArea(scope.row)" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5" link type="primary" ><el-icon><Edit /></el-icon>历史成绩</el-button>
                            <!-- <el-button @click="goTestSendWord(scope.row)" link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5" icon="el-icon-edit">考试寄语</el-button> -->
                            <!-- <el-button @click="goTestSendWord(scope.row)" link type="primary" v-if="searchParam.data.flag==0" icon="el-icon-edit">考试报告</el-button> -->
                            <el-button @click="getfenclass(scope.row)" link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5 || searchParam.data.flag==3"><el-icon><Edit /></el-icon>分班成绩</el-button>
                            <!-- 新<el-button @click="goTimeManagement(scope.row)" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5" link type="primary" icon="el-icon-edit">时间管理</el-button> -->
                            <el-button @click="goReciteWords(scope.row)" link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5" ><el-icon><Edit /></el-icon>背单词</el-button>
                            <el-button @click="toMeetingDetail(scope.row)" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5 || searchParam.data.flag==3" link type="primary" ><el-icon><Edit /></el-icon>例会详情</el-button>
                            <template #reference>
                                <el-button link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5 || searchParam.data.flag==3" icon="el-icon-setting" class="setting">更多</el-button>
                            </template>                            
                            <el-button @click="goSchedule(scope.row)" link type="primary" v-if="showCourse && searchParam.data.flag==0 && searchParam.data.classType!=1" size="small" ><el-icon><Edit /></el-icon>课表</el-button><!--1教学，0行政，行政才显示-->
                            <el-button @click="goScoreCommit(scope.row)" link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag==5" size="small" ><el-icon><Edit /></el-icon>全日制学生谈话记录</el-button>
                            <el-button @click="downloadWord(scope.row)" v-if="searchParam.data.flag==0 || searchParam.data.flag ==5" link type="primary" icon="el-icon-download">下载试题</el-button>
                            <!-- 新<el-button @click="goXqfx(scope.row)" link type="primary" v-if="searchParam.data.flag==0" size="small" icon="el-icon-view">学情分析页</el-button> -->
                            <el-button @click="goContract(scope.row)" link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag==5" size="small" ><el-icon><Edit /></el-icon>合同查看</el-button>
                            <el-button @click="goHomeworkList(scope.row)" link type="primary" v-if="searchParam.data.flag==0 || searchParam.data.flag==5" size="small" ><el-icon><Edit /></el-icon>作业清单</el-button>
                        </el-popover>                    
                    </template>
                </el-table-column>
            </el-table>
        </div>
         <!--背单词设置弹框 -->
        <el-dialog v-model="memWordVisible.value" draggable title="背单词设置" width="40%" :close-on-click-modal="true" @close='closeIt'> 
            <div class="">
                <el-form label-position="right" label-width="126px">
                    <el-form-item label="学生姓名" class="header-title">
                        <span class="htitle-color mtitle-font">{{searchParam.data.studentName}}</span>
                    </el-form-item>
                    <div v-show="isYuan">
                        <el-form-item label="原密码" class="header-title">
                            <span class="htitle-color mtitle-font">{{oldPassword.value}}</span>
                        </el-form-item>
                    </div>
                    <div v-show="isChong">
                        <el-form-item label="密码" class="header-title" >
                            <span class="htitle-color mtitle-font">{{password.value}}</span>
                        </el-form-item>
                    </div>
                    <div v-show="isKai">
                        <el-form-item label="密码" class="header-title" >
                            <span class="htitle-color mtitle-font">{{password.value}}</span>
                        </el-form-item>
                    </div>                    
                    <el-form-item class="header-title">
                        <el-button @click="goOpenCRM" v-if="!searchParam.data.isPwd">开通账户</el-button>          
                        <el-button @click="goReset" v-if="searchParam.data.isPwd">重置密码</el-button>
                        <el-button @click="closeIt">关闭</el-button>
                    </el-form-item>                   
                </el-form>
            </div>
        </el-dialog>
         <!--背单词-简单词设置弹框 -->
        <el-dialog v-model="memWordVisible2.value" draggable title="背单词设置" width="30%" :close-on-click-modal="true" @close='closeIt2'> 
            <div class="">
                <el-form label-position="right" label-width="126px" :model="enWordSettingForm.data">
                    <el-form-item label="学生姓名" class="header-title">
                        <span class="htitle-color mtitle-font">{{searchParam.data.studentName}}</span>
                    </el-form-item>
                    <el-form-item label="简单词" class="header-title">
                        <el-switch v-model="enWordSettingForm.data.ifWordType" active-color="#13ce66" inactive-color="#ddd"></el-switch>
                    </el-form-item>           
                </el-form>
            </div>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="closeIt2">取消</el-button>
                    <el-button type="primary" @click="enWordSettingSave()">保 存</el-button>
                </span>
            </template>
           
        </el-dialog>
        <!--学生类型弹框 -->
        <el-dialog v-model="studentTypeVisible.value" draggable title="学生类型" width="50%" :close-on-click-modal="false">
            <div class="el-dialog-div">
                <el-form :model="studentTypeForm.data" label-position="right" ref="studentTypeRules" label-width="126px">
                    <el-form-item label="学生姓名" class="header-title">
                        <span class="htitle-color mtitle-font">{{studentTypeForm.data.studentName}}</span>
                    </el-form-item>
                    <el-form-item label="成绩" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.stuScore">
                            <el-checkbox-button :label="0">奋进</el-checkbox-button>
                            <el-checkbox-button :label="1">北清</el-checkbox-button>
                            <el-checkbox-button :label="2">清美</el-checkbox-button>
                            <el-checkbox-button :label="3">央美</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="界别" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.stuType" :max="1">
                            <el-checkbox-button label="复读" >复读</el-checkbox-button>
                            <el-checkbox-button label="应届" >应届</el-checkbox-button>
                            <el-checkbox-button label="社会" >社会</el-checkbox-button>
                            <el-checkbox-button label="回流" >回流</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="是否多次复读" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.ifReread" :max="1">
                            <el-checkbox-button :label="0" >是</el-checkbox-button>
                            <el-checkbox-button :label="1" >否</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="类型" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.stuLevel" :max="1">
                            <el-checkbox-button :label="1" >普通</el-checkbox-button>
                            <el-checkbox-button :label="2" >艺术</el-checkbox-button>
                            <el-checkbox-button :label="3" >体育</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="高考加分" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.stuTestScore" :max="1">
                            <el-checkbox-button :label="1" >自主招生</el-checkbox-button>
                            <el-checkbox-button :label="2" >高水平艺术团</el-checkbox-button>
                            <el-checkbox-button :label="3" >高水平运动队</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="学籍所在区域" class="header-title">
                        <el-cascader v-model="studentTypeForm.data.xueji" :options="areaList"></el-cascader>
                    </el-form-item>
                    <el-form-item label="户籍所在区域" class="header-title">
                        <el-cascader v-model="studentTypeForm.data.huji" :options="areaList"></el-cascader>
                    </el-form-item>
                    <el-form-item label="报名所在区域" class="header-title">
                        <el-cascader v-model="studentTypeForm.data.baom" :options="areaList"></el-cascader>
                    </el-form-item>
                    <el-form-item label="试卷种类" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.paperType" :max="1">
                            <el-checkbox-button v-for="item in pageTypeList.data" :label="item.pagetypeId" :key="item.pagetypeId">{{item.pagetypeName}}</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="籍贯分类" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.ifBeiJing" :max="1">
                            <el-checkbox-button :label="0">京籍外地</el-checkbox-button>
                            <el-checkbox-button :label="1">京地外籍</el-checkbox-button>
                            <el-checkbox-button :label="2">京籍京地</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="全日制老生" class="header-title">
                        <el-checkbox-group v-model="studentTypeForm.data.isOldStudent" :max="1">
                            <el-checkbox-button :label="0">否</el-checkbox-button>
                            <el-checkbox-button :label="1">是</el-checkbox-button>
                        </el-checkbox-group>
                    </el-form-item>
                </el-form>
            </div>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="studentTypeVisible= false">取 消</el-button>
                    <el-button type="primary" @click="studentTypeSave(studentTypeForm.data)">保 存</el-button>
                </span>
            </template>
           
        </el-dialog>
        <!-- 分班成绩 -->
         <el-dialog v-model="fenclassVisible.value" draggable title="分班成绩" width="40%" :close-on-click-modal="true">
            <template #header>
                <div class="header-title">            
                    <span>分班成绩<span style="color:red;font-size:12px;">（点击成绩可查看考试详情）</span></span>            
                </div>
            </template>
            
            <div class="">
                <div class="percon" v-if="perScorelist.data.length > 0">
                    <p v-for="(item,index) in perScorelist.data" :key="index" @click="gofenclasspage(item)">
                        {{item.subjectName}}成绩： <span>{{item.perScore}}</span>
                    </p>
                </div>
                <div v-else>
                    <span>此学生暂无分班成绩</span>
                </div>
                </div>
        </el-dialog>
        <!-- 分班测试成绩 -->
        <el-dialog v-model="fenclassVisible1.value" draggable title="分班成绩" width="40%" :close-on-click-modal="true">
            <template #header>
                <div class="header-title">            
                    <span>分班成绩<span style="color:red;font-size:12px;">（点击成绩可查看考试详情）</span></span>            
                </div>
            </template>
           
            <div class="">
                <div class="percon" v-if="perScorelist.data.length > 0">
                    <p v-for="(item,index) in perScorelist.data" :key="index" @click="gofenclasspage(item, 1)">
                        {{item.subjectName}}成绩： <span>{{item.perScore}}</span>
                    </p>
                </div>
                <div v-else>
                    <span>此学生暂无分班成绩</span>
                </div>
                </div>
        </el-dialog>
        <!-- 历史成绩 -->
         <el-dialog v-model="historyScoreVisible.value" draggable title="历史成绩维护" width="60%" :close-on-click-modal="false" @close="historyScoreClose">
            <div class="el-dialog-divH">
                <el-form :model="historyScoreForm.data" label-position="right" ref="studentTypeRules" label-width="126px">
                    <el-form-item label="学生姓名" class="header-title">
                        <span class="htitle-color mtitle-font">{{historyScoreForm.data.studentName}}</span>
                    </el-form-item>
                    <el-form-item label="入学成绩" class="header-title">
                        <el-radio v-model="historyScoreForm.data.startType" :label="1">估算</el-radio>
                        <el-radio v-model="historyScoreForm.data.startType" :label="2">查实</el-radio>
                    </el-form-item>
                    <el-form-item label="历史成绩城区" class="header-title">
                        <el-select v-model="historyScoreForm.data.scoreArea" placeholder="请选择" v-if="isScoreArea==true" clearable>
                            <el-option v-for="item in scoreAreaList.data" :key="item.id" :label="item.name" :value="item.id"> </el-option>
                        </el-select>
                        <el-select v-model="historyScoreForm.data.scoreArea" placeholder="请选择" v-else disabled clearable>
                            <el-option v-for="item in scoreAreaList.data" :key="item.id" :label="item.name" :value="item.id"> </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="文理" class="header-title" v-if="isNewYear">
                        <el-radio-group v-model="historyScoreForm.data.subjectType" size="small" @change="selectWL" v-if="isScoreArea==true">
                            <el-radio :label='0'>文科</el-radio>
                            <el-radio :label='1'>理科</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="historyScoreForm.data.subjectType" size="small" v-else>
                            <el-radio :label='0' disabled>文科</el-radio>
                            <el-radio :label='1' disabled>理科</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-form>
                <el-table :data="newScoreList.data" border highlight-current-row  class="table scoroTable"  ref="ScoreTable" 
                    :header-cell-style="{background: '#f1f1f1', color: '#333'}">
                    <el-table-column header-align="center" align="center" prop="type"> </el-table-column>
                    <el-table-column prop="zhong" header-align="center" align="center"  label="期中">
                        <template #default="scope">
                            <input-number clearable  v-model="scope.row.zhong" :cannum="0.5" :min="0" class="text-input" :max="750" :doublelen="1" @change="showAdd(scope.$index,'zhong')"  v-if='scope.$index ==1'></input-number>
                            <input-number clearable  v-model="scope.row.zhong" :cannum="0.5" :min="0" class="text-input" :max="300" :doublelen="1" @change="showAdd(scope.$index,'zhong')"  v-if='scope.$index ==8 && isNewYear'></input-number>
                            <input-number clearable  v-model="scope.row.zhong" :cannum="0.5" :min="0" class="text-input" :max="150" :doublelen="1" @change="showAdd(scope.$index,'zhong')"  v-if='scope.$index ==2 || scope.$index==3 || scope.$index==4' ></input-number>
                            <input-number clearable  v-model="scope.row.zhong" :cannum="0.5" :min="0" class="text-input" :max="100" :doublelen="1" @change="showAdd(scope.$index,'zhong')"  v-if='scope.$index ==5 || scope.$index==6 || scope.$index==7' ></input-number>
                            <span v-if='scope.$index ==0 || (scope.$index ==9 && isNewYear)' class="words-table">
                                {{scope.row.zhong}}
                            </span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="mo"  header-align="center" align="center"  label="期末">
                        <template #default="scope">
                            <input-number clearable  v-model="scope.row.mo" :cannum="0.5" :min="0" class="text-input" :max="750" :doublelen="1" @change="showAdd(scope.$index,'mo')"  v-if='scope.$index ==1'></input-number>
                            <input-number clearable  v-model="scope.row.mo" :cannum="0.5" :min="0" class="text-input" :max="300" :doublelen="1" @change="showAdd(scope.$index,'mo')"  v-if='scope.$index ==8 && isNewYear'></input-number>
                            <input-number clearable  v-model="scope.row.mo" :cannum="0.5" :min="0" class="text-input" :max="150" :doublelen="1" @change="showAdd(scope.$index,'mo')"  v-if='scope.$index ==2 || scope.$index==3 || scope.$index==4' ></input-number>
                            <input-number clearable  v-model="scope.row.mo" :cannum="0.5" :min="0" class="text-input" :max="100" :doublelen="1" @change="showAdd(scope.$index,'mo')"  v-if='scope.$index ==5 || scope.$index==6 || scope.$index==7' ></input-number>
                            <span v-if='scope.$index ==0 || (scope.$index ==9 && isNewYear)' class="words-table">
                                {{scope.row.mo}}
                            </span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="yi"  header-align="center" align="center"  label="一模">
                        <template #default="scope">
                            <input-number clearable  v-model="scope.row.yi" :cannum="0.5" :min="0" class="text-input" :max="750" :doublelen="1" @change="showAdd(scope.$index,'yi')"  v-if='scope.$index ==1'></input-number>
                            <input-number clearable  v-model="scope.row.yi" :cannum="0.5" :min="0" class="text-input" :max="300" :doublelen="1" @change="showAdd(scope.$index,'yi')"  v-if='scope.$index ==8 && isNewYear'></input-number>
                            <input-number clearable  v-model="scope.row.yi" :cannum="0.5" :min="0" class="text-input" :max="150" :doublelen="1" @change="showAdd(scope.$index,'yi')"  v-if='scope.$index ==2 || scope.$index==3 || scope.$index==4' ></input-number>
                            <input-number clearable  v-model="scope.row.yi" :cannum="0.5" :min="0" class="text-input" :max="100" :doublelen="1" @change="showAdd(scope.$index,'yi')"  v-if='scope.$index ==5 || scope.$index==6 || scope.$index==7' ></input-number>
                            <span v-if='scope.$index ==0 || (scope.$index ==9 && isNewYear)' class="words-table">
                                {{scope.row.yi}}
                            </span>
                        </template>
                    </el-table-column>
                    <el-table-column  prop="er"   header-align="center"  align="center"   label="二模">
                        <template #default="scope">
                            <input-number clearable  v-model="scope.row.er" :cannum="0.5" :min="0" class="text-input" :max="750" :doublelen="1" @change="showAdd(scope.$index,'er')"  v-if='scope.$index ==1'></input-number>
                            <input-number clearable  v-model="scope.row.er" :cannum="0.5" :min="0" class="text-input" :max="300" :doublelen="1" @change="showAdd(scope.$index,'er')"  v-if='scope.$index ==8 && isNewYear'></input-number>
                            <input-number clearable  v-model="scope.row.er" :cannum="0.5" :min="0" class="text-input" :max="150" :doublelen="1" @change="showAdd(scope.$index,'er')"  v-if='scope.$index ==2 || scope.$index==3 || scope.$index==4' ></input-number>
                            <input-number clearable  v-model="scope.row.er" :cannum="0.5" :min="0" class="text-input" :max="100" :doublelen="1" @change="showAdd(scope.$index,'er')"  v-if='scope.$index ==5 || scope.$index==6 || scope.$index==7' ></input-number>
                            <span v-if='scope.$index ==0 || (scope.$index ==9 && isNewYear)' class="words-table">
                                {{scope.row.er}}
                            </span>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="historyScoreClose">取 消</el-button>
                    <el-button type="primary" @click="historyScoreSave">保 存</el-button>
                </span>
            </template>
           
        </el-dialog>
        <!-- 考试报告 -->
        <el-dialog draggable title="生成学生考试报告" v-model="scoreAvgVisible.value" width="30%" :close-on-click-modal="false" >
            <div class="el-dialog-divH">
                <el-form class="demo-form-inline" :model="testScoreParam.data" label-position="right" label-width="120px"
                >
                    <el-form-item class="nine-form-title" label="考试批次" prop="testId">
                        <el-select v-model="testScoreParam.data.testId" clearable style="100%" placeholder="请选择" >
                            <el-option v-for="item in kspcList" :key="item.testId" :label="item.simpleName" :value="item.testId" ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item class="nine-form-title" label="弱科分析维度" prop="analysisWd">
                        <template>
                            <el-radio v-model="testScoreParam.data.analysisWd" label="hd">海淀百分比</el-radio>
                            <el-radio v-model="testScoreParam.data.analysisWd" label="jh">精华百分比</el-radio>
                        </template>
                    </el-form-item>                   
                </el-form>
            </div>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="scoreAvgVisible.value = false">取 消</el-button>
                    <el-button type="primary" @click="goScoreCityAvg">生成PDF</el-button>
                </span>
            </template>
           
        </el-dialog>
        <!-- 下载试题 -->
        <el-dialog v-model="downwordVisible.value" draggable title="考试批次" width="30%" :close-on-click-modal="false">
            <div class="el-dialog-div">
                <el-form class="demo-form-inline" :model="testForm.data" :rules="testRules" ref="testRulesRef" label-position="right" label-width="120px">
                    <el-form-item class="nine-form-title" label="考试批次" prop="testId">
                        <el-select v-model="testForm.data.testId" clearable style="100%" placeholder="请选择" >
                            <el-option v-for="item in kspcList" :key="item.testId" :label="item.simpleName" :value="item.testId"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item class="nine-form-title" label="科目" prop="subjectId">
                        <el-select v-model="testForm.data.subjectId" clearable style="100%" placeholder="请选择">
                            <el-option v-for="item in subjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                        </el-select>
                    </el-form-item>             
                </el-form>
            </div>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="downwordVisible.value = false">取 消</el-button>
                    <el-button type="primary" @click="confirmDonload">下载Word</el-button>
                </span>
            </template>           
        </el-dialog>
    </div>
</template>

<script setup lang="ts" name="showClassStudents">
import { baseUrl } from '@/utils/api';
import { toCusInfo } from '@/utils/helper';
import inputNumber from '../../../../common/input-number.vue';
import {useStore} from 'vuex';
import { getCurrentInstance, reactive, ref, computed, onMounted, onActivated, onDeactivated } from 'vue';
import { onBeforeRouteLeave, useRoute, useRouter } from 'vue-router';
function downFile(blob, fileName) {
    if (window.navigator.msSaveOrOpenBlob) {
        navigator.msSaveBlob(blob, fileName);
    } else {
        var link = document.createElement('a');
        link.href = window.URL.createObjectURL(blob);
        link.download = fileName;
        link.click();
        window.URL.revokeObjectURL(link.href);
    }
}
let route = useRoute();
let router = useRouter();
let store = useStore();
let yearly= ref(2020);//2020年比较新、旧数据
let {proxy} = getCurrentInstance() as any;
let schoollList = reactive({data:[]});//高考学校列表
let oneInfo= reactive({data:{}});
let tableHeight= ref(50);
let searchParam=({data: {}});
let showCourse=ref(false);
let isDel=ref(false);
let dataLists=reactive({data: []});
let kspcList=reactive({data:[]});//考试批次
let testIdA=ref(''); //详情页跳转用的考试批次
let memWordVisible=ref(false);//背单词设置
let memWordVisible2=ref(false);//背单词-简单词设置
let studentTypeVisible=ref(false);//学生类型弹框
let fenclassVisible=ref(false);//分班成绩弹框
let fenclassVisible1=ref(false);//分班成绩弹框
let historyScoreVisible=ref(false);//历史成绩弹窗
let scoreAvgVisible=ref(false);//生成考试报告弹窗
let testScoreParam=reactive({
    data: {
        studentName:'',
        classId:'',
        studentId:'',
        customerId:'',
        testId:'',
        analysisWd:'hd'
    }
});
let studentTypeForm=reactive({//学生类型
    data: {
        stuScore: [],//成绩
        stuType: [],//界别
        ifReread:[],//是否多次复读
        stuLevel: [],//类型
        stuTestScore: [],//高考加分
        huji: [],//户籍所在区域
        xueji: [],//学籍所在区域
        baom: [],//报名所在区域
        paperType: [],//试卷种类
        ifBeiJing: [],//籍贯分类
        isOldStudent: [],//全日制老生
    }
});
let pageTypeList=reactive({data: []});//试卷种类
let areaList=reactive({data: []});
let perScorelist=reactive({data: []});//分班成绩
let customerId=ref('');//选中学生的id
let scoreAreaList=reactive({data: []});
let historyScoreForm=reactive({
    data: {
        studentName:"",
        scoreArea:"",
        startType:"",
        subjectType:"", 
        yearly:"",
        scoreList:[
            {type:"examType",zhong:16,mo:8,yi:4,er:2},//考试批次id
            {type:"编辑状态",zhong:0,mo:0,yi:0,er:0},//成绩编辑状态，0未更改，1已修改
            {type:"id",zhong:'',mo:'',yi:'',er:''}
            // 
        ]//综合成绩之和
    }
})
let enWordSettingForm=reactive({
    data: {
        ifWordType:''
    }
})
let isScoreArea=ref(true);
let theScore=reactive([]);
//旧数据
let oldScoreList= reactive({
    data: [
        {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
        {type:"总分",zhong:"",mo:"",yi:"",er:""},
        {type:"语文",zhong:"",mo:"",yi:"",er:""},
        {type:"数学",zhong:"",mo:"",yi:"",er:""},
        {type:"英语",zhong:"",mo:"",yi:"",er:""},
        {type:"历史",zhong:"",mo:"",yi:"",er:""},
        {type:"地理",zhong:"",mo:"",yi:"",er:""},
        {type:"政治",zhong:"",mo:"",yi:"",er:""},
        {type:"综合",zhong:"",mo:"",yi:"",er:""},
        {type:"",zhong:"",mo:"",yi:"",er:""}
    ],
});
let newScoreList=reactive({
    data: [
        {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
        {type:"总分",zhong:"",mo:"",yi:"",er:""},
        {type:"语文",zhong:"",mo:"",yi:"",er:""},
        {type:"数学",zhong:"",mo:"",yi:"",er:""},
        {type:"英语",zhong:"",mo:"",yi:"",er:""},
        {type:"历史",zhong:"",mo:"",yi:"",er:""},
        {type:"地理",zhong:"",mo:"",yi:"",er:""},
        {type:"政治",zhong:"",mo:"",yi:"",er:""},
        {type:"综合",zhong:"",mo:"",yi:"",er:""},
        {type:"",zhong:"",mo:"",yi:"",er:""}
    ]
})
let loading=ref(false);
let isChong=ref(false); //是否为密码重置
let isKai=ref(false); //是否为密码开通
let isYuan=ref(false); //原密码显示
let password=ref('');
let subjectList=reactive({
    data: [
        {id: 101,name: '语文'},
        {id: 102,name: '数学'},
        {id: 103,name: '英语'},
        {id: 104,name: '物理'},
        {id: 105,name: '化学'},
        {id: 106,name: '生物'},
        {id: 107,name: '历史'},
        {id: 108,name: '地理'},
        {id: 109,name: '政治'}
    ]}
);
let downwordVisible=ref(false);//下载试题
let testForm= reactive({
    testId: '',
    subjectId: '',
});
let testRules=reactive(
    {
        testId: [{ required: true, message: '请选择考试批次！', trigger: 'change' }],
        subjectId: [{ required: true, message: '请选择科目', trigger: 'change' }],
    }
); 
let oldPassword=ref('');
let ifEnTeacher=ref('');
let userInfo= reactive({
    data: {
        subjectId:''
    }
});
const isNewYear = computed(()=>{return historyScoreForm.data.yearly< yearly.value;}); //判断该学生的是否是2020年之前的保持不变，新的要隐藏

let getSessionSearch=async ()=>{
    if(JSON.stringify(route.params)!='{}'){
        searchParam.data = {...searchParam.data, ...route.params};
    }else{
        let search = JSON.parse(window.sessionStorage.getItem("vuex"))
        if(JSON.stringify(search.showClassStudents.routeParams)!='{}'){
            searchParam.data = {...searchParam.data,...search.showClassStudents.routeParams}
        }
    }
    if(!searchParam.data.radio){
        searchParam.data.radio = 1;
    }
    // this.searchParam = this.$route.params;
    
    if(searchParam.data.paperType===0 && searchParam.data.grade == 17){
        showCourse.value = true;
    }else{
        showCourse.value = false;
    }
    await getDataList();  
    await getPageType();   
    await getScoreArea();     
    await getAreaList();    
    await getSchoollList(); 
    await getTeacherSub(); 
};
let getDataList=()=>{
    loading.value = true;
    let param = new URLSearchParams();
    if(searchParam.data.id || !isNaN(searchParam.data.id)){
        param.append("id", searchParam.data.id);
    }
    // if(this.searchParam.radio || !isNaN(this.searchParam.radio)){
    //     param.append("radio", this.searchParam.radio);
    // }
    param.append("flag", 1);
    proxy.$post(baseUrl + '/ft/educationcontroller/query_student.do', param)
        .then(res =>{
            if(res.data.code == 0){
                dataLists.data = res.data.data;
            }
            loading.value = false;
        }, err =>{
            proxy.$message.error(err);
            loading.value = false;
        }
    )
};
//获取登录教师科目
let getTeacherSub=()=>{
    proxy.$get(baseUrl+'/ot/ftchoose/getUserInfo.do').then(res => {
        if(res.data.code==0){  
            ifEnTeacher.value = false;
            userInfo.data.subjectId = res.data.subjectId
            if(userInfo.data.subjectId == 103){
                ifEnTeacher.value = true
            }
        }
    }, err => {
        proxy.$message.error(err);
    });
};
/**
 * 获取市、县、区
 */
let getAreaList=()=>{
    let param = new URLSearchParams();
    proxy.$post( baseUrl + '/ft/ftchoose/getProvinceCityArea.do', param)
        .then(res=>{
            if(res.data.code == 0){
                areaList.data = res.data.data;
            }else{
                proxy.$message.error(res.data.msg);
            }
        })
};
/**
 * 获取历史成绩城区
 */
let getScoreArea=()=>{
    let param = new URLSearchParams();
    proxy.$post( baseUrl + '/ft/ftchoose/getCityAreaOfBj.do')
        .then(res=>{
            if(res.data.code == 0){
                scoreAreaList.data = res.data.data;
            }else{
                proxy.$message.error(res.data.msg);
            }
        })
};
/**
 * 试卷种类列表
 */
let getPageType=()=>{
    let param = new URLSearchParams();
    proxy.$post( baseUrl + '/ft/ftchoose/getPagetypeList.do', param)
        .then(res=>{
            if(res.data.code == 0){
                pageTypeList.data = res.data.data;
            }else{
                proxy.$message.error(res.data.msg);
            }
        })
};
/**
 * 开通账号
 */
let goOpenCRM=()=>{
    
    // this.searchParam.isPwd=true
    goReset();
};
/**
 * 课表重置密码
 */
let goReset=()=>{
    let param = new URLSearchParams();
    param.append("id", searchParam.data.studentId || '');
    proxy.$post(baseUrl + '/ft/educationcontroller/resetPassWord.do', param)
        .then(res =>{
            if(res.data.code == 0){
                getDataList();
                if(searchParam.data.isPwd){
                    // _this.$message({
                    //     message: '重置成功，密码为123456',
                    //     type: 'success'
                    // });
                    isChong.value = true;
                }else{
                    // this.$message.success('开通成功，密码为123456');
                    isKai.value = true
                }
                password.value = res.data.data
                isYuan.value = false;
                
            }else{
                proxy.$message.error(res.data.msg);
            }
        }, err =>{
            proxy.$message.error('服务器错误！')
        }
    )
};
let closeIt=()=>{
    memWordVisible.value = false;
    isChong.value = false;
    isKai.value = false;
    isYuan.value = false;
};
let closeIt2=()=>{
    memWordVisible2.value = false;
};
let getTableData=()=>{
    getDataList();
};

/**
 * 学生课表
 */
let goSchedule=(row, key)=>{
    isDel.value=true;
    /*  let params = {
        allName: row.allName,//学生姓名
        studentId: row.studentId,//学生学号
        customerId: row.id,//学生id
        classId: this.searchParam.id,//班级id
    };
    this.$store.commit('studentsSchedule/setRouteParams', params);
    this.$router.push({
        name: 'studentsSchedule',
        path: '/studentsSchedule',
        params: params
    }) */
    let params ={
        yearly: row.yearly,
        studentId: row.studentId,
        studentName: row.allName,//学生姓名
        classId: searchParam.data.id,//班级id
    }
    store.commit('stuSchedule/setRouteParams', params);
    router.push({
        name: "stuSchedule",
        params: params
    });
};
/**
 * TODO 
 * 跳转成绩首页
 */
let goAchievementHomePage=(row)=>{
    console.log(row)
    let params ={
        customerId: row.id ||'',
        yearly: row.yearly || '',
        classInfo : 1,
        studentId: row.studentId || '',
        grade: row.grade || '',
        index: true,
        paperType: '0',
        subjectIds:row.subjectIds || '',
        // isArtExam: row.isArtExam || '',
    }
    let routeData = router.resolve({ 
        name: 'studentHomePage1'
    });
    window.open(routeData.href +'?@pageFlag=stu', '_blank');
};
/**
 * 6+1跳转
 */
let goSixOne=(row,)=>{
    isDel.value=true;
    let params = {
        allName: row.allName,//学生姓名
        studentId: row.studentId,//学生学号
        customerId: row.id,//学生id
        classId: searchParam.data.id,//班级id
    }
    store.commit('showSixOne/setRouteParams', params);
    router.push({
        name: 'showSixOne',
        path: '/showSixOne',
        params: params
    })
};
/**
 * 沟通记录跳转
 */
let goConnect=(row)=>{
    isDel.value=true;
    let params = {
        allName: row.allName,//学生姓名
        studentId: row.studentId,//学生学号
        studentNo: row.id,//学生id
        classId: searchParam.data.id,//班级id
    }
    store.commit('showStudentLinkPage/setRouteParams', params);
    router.push({
        name: 'showStudentLinkPage',
        path: '/showStudentLinkPage',
        params: params
    })
};

//跳转到成绩与沟通页面
let goScoreCommit=(row)=>{
    console.log(row)
    let params ={
        customerId: row.id ||'',
        key:1,
        showPanel:'crm',
        ifqrz: row.ifqrz || '',
        isLook: true
    }
    let routeData = router.resolve({ 
        name: 'scoreCommunication'
    });
    window.open(routeData.href +'?@pageFlag=talk', '_blank');
};
/**
 * 考试寄语跳转
 */
let goTestSendWord=(row)=>{
    isDel.value=true;
    let params = {
        allName: row.allName,//学生姓名
        studentId: row.studentId,//学生学号
        customerId: row.id,//学生id
        classId: searchParam.data.id,//班级id
    }
    store.commit('testSendWord/setRouteParams', params);
    router.push({
        name: 'testSendWord',
        path: '/testSendWord',
        params: params
    })
};
/**
 * 学情分析页调整
 */
let goXqfx=(row)=>{//跳转路径页面
let params ={
        customerId: row.id ||'',
        yearly: row.yearly || '',
        classInfo : 1,
        studentId: row.studentId || '',
        grade: row.grade || '',
        index: true,
        paperType: '0',
        subjectIds:row.subjectIds || '',
        testId: testIdA.value ||'',
        type: 1
    }
    let routeData = router.resolve({ 
        name: 'studentHomePage'
    });
    window.open(routeData.href +'?@pageFlag=stu', '_blank');
};
/**
 * 背单词设置
 */
let goReciteWords=(row)=>{   
    searchParam.data.studentId = row.id;
    searchParam.data.studentName = row.allName;                   
    searchParam.data['isPwd']= row.password ? true: false;
    memWordVisible.value = true; 
    let Base64 = require('js-base64').Base64
    if(row.password){
        isYuan.value = true;
        oldPassword.value = Base64.decode(row.password);
    }
    
};
// 背单词-简单词设置
let goEnWordSetting=(row)=>{
   memWordVisible2.value = true;
   searchParam.data.studentId = row.id;
   searchParam.data.studentName = row.allName;
    if(row.ifWordType){
        enWordSettingForm.data.ifWordType = true
    }else{
        enWordSettingForm.data.ifWordType = false
    }
};
let enWordSettingSave=()=>{
    if(enWordSettingForm.data.ifWordType){
        enWordSettingForm.data.ifWordType = 1
    }else{
        enWordSettingForm.data.ifWordType = 0
    }
    let param = new URLSearchParams();
    param.append("id", searchParam.data.studentId || '');
    param.append("wordType", enWordSettingForm.data.ifWordType);
    proxy.$post(baseUrl + '/ft/educationcontroller/save_student_ifWordType.do', param)
        .then(res =>{
            if(res.data.code == 0){
                getDataList();
            }else{
                proxy.$message.error(res.data.msg);
            }
        }, err =>{
            proxy.$message.error('服务器错误！')
        }
    )
    memWordVisible2.value = false;
};
/**
 * 学生类型弹框
 */
let goStudentType=(row)=>{
    isDel.value=true;
    let params = {
        allName: row.allName,//学生姓名
        studentId: row.studentId,//学生学号
        customerId: row.id,//学生id
        classId: searchParam.data.id,//班级id
    }
    store.commit('studentsType/setRouteParams', params);
    router.push({
        name: 'studentsType',
        path: '/studentsType',
        params: params
    })
};
//学生类型弹框保存
let studentTypeSave=(item)=>{
    let param = new URLSearchParams();
    param.append('customerId', studentTypeForm.data.customerId || '');
    param.append('stuScore', getValueArr(studentTypeForm.data.stuScore));
    param.append('stuType', getValueArr(studentTypeForm.data.stuType));
    param.append('ifReread', getValueArr(studentTypeForm.data.ifReread));
    param.append('stuLevel', getValueArr(studentTypeForm.data.stuLevel));
    param.append('stuTestScore', getValueArr(studentTypeForm.data.stuTestScore));
    param.append('paperType', getValueArr(studentTypeForm.data.paperType));
    param.append('ifBeiJing', getValueArr(studentTypeForm.data.ifBeiJing));
    param.append('isOldStudent', getValueArr(studentTypeForm.data.isOldStudent));
    param.append('huji', studentTypeForm.data.huji);
    param.append('xueji', studentTypeForm.data.xueji);
    param.append('baom',studentTypeForm.data.baom);
    proxy.$post(baseUrl + '/ft/educationcontroller/saveClassManager.do', param)
        .then(res =>{
            if(res.data.code == 0){
                proxy.$message.success('保存成功！');
                getDataList();
                studentTypeVisible.value = false;
            }else{
                proxy.$message.error(res.data.msg);
            }
        }, err =>{
            proxy.$message.error('服务器错误！')
        }
    )
    studentTypeVisible.value = true;
};
//保存的时候转格式，回显的时候转格式
let getValueArr=(value, info)=>{
    if(value && value.constructor == Array){//保存的时候，显示为数组，转成值
        if(value.length>0 && value.length<=1){
            return value[0];
        }else if(value.length>1){
            let arr = [];
            value.forEach(item=>{
                if(!isNaN(item)){
                    arr.push(Number(item));
                }
            })
            return arr;
        }else{
            return '';
        }
    }else if(value || value===0){//从后台拿回来是值，显示为数组
        let val;
        let arr = [];
        val = String(value).split(',');
        if(!isNaN(Number(value[0]))){//数字
            val.forEach((item,index)=>{
                arr.push(Number(item));
            });
            val = arr;
        }
        return val;
    }else{
        return [];
    }
    
};
/**
 * 时间管理
 */
let goTimeManagement=(row)=>{
    isDel.value=true;
    let params = {
        allName: row.allName,//学生姓名
        studentId: row.studentId,//学生学号
        customerId: row.id,//学生id
        classId: this.searchParam.id,//班级id
    }
    store.commit('showTimeManagement/setRouteParams', params);
    router.push({
        name: 'showTimeManagement',
        path: '/showTimeManagement',
        params: params
    })
};
let changgeStuInfo=(row)=>{
    isDel.value=true;
    // 跳转到基本客户信息修改页面
    router.push({
        name:'baseInfoModify',
        path: '/baseInfoModify',
        params:{
            flag: searchParam.data.flag,//班主任班级管理-学生名单跳转时会带flag参数，flag=0；
            customerId: row.id, //学生id
            schoollList: schoollList.data
        }
    })
};
//跳转到班级例会
let toMeetingDetail=(row)=>{
    isDel.value=true;
    let params = {
        customerId: row.id,
        beginDate: '',
        endDate:'',
        studentName: row.allName,
    }
    store.commit('showClassMeetingDetail/setRouteParams', params);
    router.push({
        name: 'showClassMeetingDetail',
        params: params
    })
};
let goContract=(row)=>{
    isDel.value=true;
    let params = {
        customerId: row.id,//学生id
    }
    store.commit('contractV/setRouteParams', params);
    router.push({
        name: 'contractV',
        path: '/contractV',
        params: params
    })
};
let goHomeworkList=(row)=>{
    isDel.value=true;
    let params = {
        classId:this.searchParam.id,
        customerId: row.id,//学生id
    }
    store.commit('homeworkList/setRouteParams', params);
    router.push({
        name: 'homeworkList',
        path: '/homeworkList',
        params: params
    })
};
//客户详情
let studentInfo=(row)=>{
    toCusInfo(row.id);
    //  this.$axios.post(baseUrl+'/ft/ftchoose/getUserInfo.do').then(res => {
    //     if(res.data!=null && res.data!='' && res.data.code==0){
    //         let url='/common/login/returnQrz.do?userRoleId='+res.data.userRole
    //             +'&gname=客户详情&gurl=/common/customer/customer_index.do?customerId='+row.id
    //             +'&gparm=;userRole='+res.data.userRole;
    //         window.open(baseUrl+url);
    //     }else{
    //         this.$message.error(res.data.msg);
    //     }
    // }, err => {
    //     this.$message.error(err);
    // });
};
    /**
 * 高考学校列表获取
 */
let getSchoollList=()=>{     
    proxy.$get(baseUrl +'/ft/ftchoose/get_school.do')
        .then(res=>{
            if(res.data.code == 0){
                schoollList.data = res.data.data;
            }
        }, err=>{
            proxy.$message.error("服务器错误！")
        })
};
let getfenclass=(row, index)=>{
    if(index==1){
        fenclassVisible1.value=true;//点击分班测试成绩
    }else{
        fenclassVisible.value=true;//点击分班成绩
    }         
    customerId.value=row.id;//选中学生的id
    let url = "/ft/ftcustomer/getCustomerTestScoreOfEntrance.do";
    if(index){
        url = "/ft/ftteaching/getPlacementTestScoreInfo.do";
    }
    proxy.$get( baseUrl + url +'?customerId='+row.id)
        .then(res=>{
            if(res.data.code == 0){
                perScorelist.data = res.data.data;
            }else{
                proxy.$message.error(res.data.msg);
            }
        })
    
};
let gofenclasspage=(item,index)=>{
    isDel.value=true;
    let params = {};
    let routeName = '';
    if(index==1){
        params={
            //跳转到分班测试成绩页面
            customerId:item.customerId,
            testPaperId:item.testPaperId,
            kemu:item.subjectName,
            subjectId: item.subjectId,
        }
        routeName = 'tklookprizexq';
    }else{
        //跳转到分班成绩页面
        params = {
            customerId:customerId.value,
            testPaperId:item.testPaperId,
            kemu:item.subjectName
        };
        routeName = 'lookprizexq';
    }                
    
    store.commit(routeName + '/setRouteParams', params);
    router.push({
        name: routeName,
        params: params
    })
    fenclassVisible.value=false;
    fenclassVisible1.value=false;
};
/**
 * 历史成绩框展现
 */
let showScoreArea=(row)=>{
    // 基本信息区域，不用更改
    historyScoreVisible.value = true;
    historyScoreForm.data.customerId = row.id;
    historyScoreForm.data.classId = this.searchParam.id;
    historyScoreForm.data.studentName = row.allName;
    historyScoreForm.data.yearly = row.yearly;//学生学年
    historyScoreForm.data['chooseSubjects']= row.subjectNames||'';//该学生选科
    proxy.$post(baseUrl+'/ft/ftcustomer/getCustomerHistoryScore.do?customerId='+row.id+'&classId='+searchParam.data.id).then(res=>{
        if(res.data.data.subjectType==undefined){
            res.data.data.subjectType=''
        }
        historyScoreForm.data.subjectType = res.data.data.subjectType;//文 理 默认0  0=>文，1=>理
        if(_this.isNewYear){//2020学年之前
            if(historyScoreForm.data.subjectType==1){
                newScoreList.data = [
                    {type:"",zhong:"",mo:"",yi:"",er:""},
                    {type:"总分",zhong:"",mo:"",yi:"",er:""},
                    {type:"语文",zhong:"",mo:"",yi:"",er:""},
                    {type:"数学",zhong:"",mo:"",yi:"",er:""},
                    {type:"英语",zhong:"",mo:"",yi:"",er:""},
                    {type:"物理",zhong:"",mo:"",yi:"",er:""},
                    {type:"化学",zhong:"",mo:"",yi:"",er:""},
                    {type:"生物",zhong:"",mo:"",yi:"",er:""},
                    {type:"综合",zhong:"",mo:"",yi:"",er:""},
                    {type:"",zhong:"",mo:"",yi:"",er:""}]
            }else{
                newScoreList.data = [
                {type:"",zhong:"",mo:"",yi:"",er:""},
                {type:"总分",zhong:"",mo:"",yi:"",er:""},
                {type:"语文",zhong:"",mo:"",yi:"",er:""},
                {type:"数学",zhong:"",mo:"",yi:"",er:""},
                {type:"英语",zhong:"",mo:"",yi:"",er:""},
                {type:"历史",zhong:"",mo:"",yi:"",er:""},
                {type:"地理",zhong:"",mo:"",yi:"",er:""},
                {type:"政治",zhong:"",mo:"",yi:"",er:""},
                {type:"综合",zhong:"",mo:"",yi:"",er:""},
                {type:"",zhong:"",mo:"",yi:"",er:""}]
            }
        }else{
            newScoreList.data = [
                {type:"",zhong:"",mo:"",yi:"",er:""},
                {type:"总分",zhong:"",mo:"",yi:"",er:""},
                {type:"语文",zhong:"",mo:"",yi:"",er:""},
                {type:"数学",zhong:"",mo:"",yi:"",er:""},
                {type:"英语",zhong:"",mo:"",yi:"",er:""},
                // {type:"物理",zhong:"",mo:"",yi:"",er:""},
                // {type:"化学",zhong:"",mo:"",yi:"",er:""},
                // {type:"生物",zhong:"",mo:"",yi:"",er:""},
                // {type:"综合",zhong:"",mo:"",yi:"",er:""},
                // {type:"",zhong:"",mo:"",yi:"",er:""}
            ];
            let chooseSubjects = historyScoreForm.data.chooseSubjects.split(',');
            chooseSubjects.forEach((item,index)=>{
                newScoreList.data.push({
                    type: item,
                    zhong: "",
                    mo: "",
                    yi: "",
                    er: ""
                })
            })
            newScoreList.data.push({
                type: '',
                zhong: "",
                mo: "",
                yi: "",
                er: ""
            })
        }
        
        if(res.data.data.cityAreaId!=undefined){
            historyScoreForm.data.scoreArea = parseInt(res.data.data.cityAreaId);
        }else{
            historyScoreForm.data.scoreArea = ""
        }
        if(res.data.data.startType!=undefined && res.data.data.startType!=null){
            historyScoreForm.data.startType = res.data.data.startType||'';
        }
        theScore = res.data.data.scorelist;
        var kemu = ["inAll","inCh","inEn","inMa","inO1","inO2","inO3","inOA"]
        let scores = res.data.data.scorelist;
        
        if(scores.length<=0){
            isScoreArea.value = true;
        }else{
            isScoreArea.value = false;
            scores.forEach((item,index,array)=>{
            for(var key in historyScoreForm.data.scoreList[0]){
                if(historyScoreForm.data.scoreList[0][key] == item.examType){
                    historyScoreForm.data.scoreList[2][key] = item.id//加入考试的id
                    kemu.forEach((its,index,array)=>{
                        if(item[its]===null&&(item[its]!=='0'||item[its]!==0)){
                            item[its]=''
                        }
                        newScoreList.data[index+1][key] = item[its];
                        oldScoreList.data[index+1][key] = item[its];
                    })
                }
            }
        })
        }
        
    },err=>{
        this.$message.error("服务器错误！")
    })
};
let historyScoreClose=()=>{
    historyScoreVisible.value= false;
    historyScoreForm.data.scoreList=[
        {type:"examType",zhong:16,mo:8,yi:4,er:2},//考试批次id
        {type:"编辑状态",zhong:0,mo:0,yi:0,er:0},//成绩编辑状态，0未更改，1已修改
        {type:"id",zhong:'',mo:'',yi:'',er:''}
    ];
    newScoreList.data=[{type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
            {type:"总分",zhong:"",mo:"",yi:"",er:""},
            {type:"语文",zhong:"",mo:"",yi:"",er:""},
            {type:"数学",zhong:"",mo:"",yi:"",er:""},
            {type:"英语",zhong:"",mo:"",yi:"",er:""},
            {type:"历史",zhong:"",mo:"",yi:"",er:""},
            {type:"地理",zhong:"",mo:"",yi:"",er:""},
            {type:"政治",zhong:"",mo:"",yi:"",er:""},
            {type:"综合",zhong:"",mo:"",yi:"",er:""},
            {type:"",zhong:"",mo:"",yi:"",er:""}];
    oldScoreList.data=[{type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
            {type:"总分",zhong:"",mo:"",yi:"",er:""},
            {type:"语文",zhong:"",mo:"",yi:"",er:""},
            {type:"数学",zhong:"",mo:"",yi:"",er:""},
            {type:"英语",zhong:"",mo:"",yi:"",er:""},
            {type:"历史",zhong:"",mo:"",yi:"",er:""},
            {type:"地理",zhong:"",mo:"",yi:"",er:""},
            {type:"政治",zhong:"",mo:"",yi:"",er:""},
            {type:"综合",zhong:"",mo:"",yi:"",er:""},
            {type:"",zhong:"",mo:"",yi:"",er:""}]
};
//监控文理科变化，展示对应的科目
let selectWL=()=>{
    if(historyScoreForm.data.subjectType==1){
        newScoreList.data = [
            {type:"",zhong:"",mo:"",yi:"",er:""},
            {type:"总分",zhong:"",mo:"",yi:"",er:""},
            {type:"语文",zhong:"",mo:"",yi:"",er:""},
            {type:"数学",zhong:"",mo:"",yi:"",er:""},
            {type:"英语",zhong:"",mo:"",yi:"",er:""},
            {type:"物理",zhong:"",mo:"",yi:"",er:""},
            {type:"化学",zhong:"",mo:"",yi:"",er:""},
            {type:"生物",zhong:"",mo:"",yi:"",er:""},
            {type:"综合",zhong:"",mo:"",yi:"",er:""},
            {type:"",zhong:"",mo:"",yi:"",er:""}]
    }else{
        newScoreList.data = [
        {type:"",zhong:"",mo:"",yi:"",er:""},
        {type:"总分",zhong:"",mo:"",yi:"",er:""},
        {type:"语文",zhong:"",mo:"",yi:"",er:""},
        {type:"数学",zhong:"",mo:"",yi:"",er:""},
        {type:"英语",zhong:"",mo:"",yi:"",er:""},
        {type:"历史",zhong:"",mo:"",yi:"",er:""},
        {type:"地理",zhong:"",mo:"",yi:"",er:""},
        {type:"政治",zhong:"",mo:"",yi:"",er:""},
        {type:"综合",zhong:"",mo:"",yi:"",er:""},
        {type:"",zhong:"",mo:"",yi:"",er:""}]
    }
};
/**
 * 历史成绩 内容保存
 */
let historyScoreSave=()=>{
    //提交时在进行验证
    if(isNewYear.value){
        if(historyScoreForm.data.subjectType===0){
            if(!historyScoreForm.data.scoreArea){
                return proxy.$message.error("历史城区不能为空");
            }
        }else{
            if(!historyScoreForm.data.scoreArea||!historyScoreForm.data.subjectType){
                return proxy.$message.error("历史城区与文理科部分不能为空，");
            }
        }
    }else{
        historyScoreForm.data.subjectType = 0;
        if(!historyScoreForm.data.scoreArea){
            return proxy.$message.error("历史城区不能为空");
        }
    }
    
    let lists = [];
    for(var key in historyScoreForm.data.scoreList[1]){
        if(historyScoreForm.data.scoreList[1][key]==1){
            lists.push(key);
        };
    };
    if(lists.length<=0){
        this.$message("当前未对成绩进行修改，请更改后再进行保存");
        return;
    };
    //   lists.forEach   验证成绩的合理性
    var isNext =true;
    lists.forEach((item,index,array)=>{
        let kemu = '';
        if(item == 'zhong'){
            kemu = "期中"
        }else if(item == 'mo'){
            kemu = "期末"
        }else if(item == 'yi'){
            kemu = "一模"
        }else if(item == 'er'){
            kemu = "二模"
        }

        if(Number(newScoreList.data[1][item])<Number(newScoreList.data[2][item])+Number(newScoreList.data[3][item])+Number(newScoreList.data[4][item])+Number(newScoreList.data[5][item])+Number(newScoreList.data[6][item])+Number(newScoreList.data[7][item])){
            this.$message.error(kemu+'成绩分数不合理，请调整！六科成绩之和不得高于总成绩')
            isNext = false;
            return isNext;
        };
        if(Number(newScoreList.data[5][item])+Number(newScoreList.data[6][item])+Number(newScoreList.data[7][item])>Number(newScoreList.data[8][item])){
            this.$message.error(kemu+'成绩分数不合理，请调整！物理+化学+生物（历史+地理+政治）不能大于综合；')
            isNext = false;
            return isNext;
        }
    });
    if(isNext){
        if(!historyScoreForm.data.startType){
            historyScoreForm.data.startType='';
        }
        if(!historyScoreForm.data.scoreList[3]){
            newScoreList.data.forEach((item,index,array)=>{
                historyScoreForm.data.scoreList.push(item);
            })
        }
        var scoreForm = JSON.stringify(historyScoreForm.data);
        let param = new URLSearchParams();
        param.append("scoreForm",scoreForm);
        proxy.$post(baseUrl+'/ft/ftcustomer/saveCustomerExaminationScore.do',param).then(res=>{
            if(res.data.code==0){
                proxy.$message.success('历史成绩保存成功');
                historyScoreVisible.value=false;
                for(var key in historyScoreForm.data){
                    if(key == 'scoreList'){
                        historyScoreForm.data.scoreList=[
                            {type:"examType",zhong:16,mo:8,yi:4,er:2},//考试批次id
                            {type:"编辑状态",zhong:0,mo:0,yi:0,er:0},//成绩编辑状态，0未更改，1已修改
                            {type:"id",zhong:'',mo:'',yi:'',er:''}
                        ];
                    }else{
                        historyScoreForm.data[key]=''
                    }
                }
                newScoreList.data=[
                    {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
                    {type:"总分",zhong:"",mo:"",yi:"",er:""},
                    {type:"语文",zhong:"",mo:"",yi:"",er:""},
                    {type:"数学",zhong:"",mo:"",yi:"",er:""},
                    {type:"英语",zhong:"",mo:"",yi:"",er:""},
                    {type:"历史",zhong:"",mo:"",yi:"",er:""},
                    {type:"地理",zhong:"",mo:"",yi:"",er:""},
                    {type:"政治",zhong:"",mo:"",yi:"",er:""},
                    {type:"综合",zhong:"",mo:"",yi:"",er:""},
                    {type:"",zhong:"",mo:"",yi:"",er:""}];
                oldScoreList.data=[
                    {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
                    {type:"总分",zhong:"",mo:"",yi:"",er:""},
                    {type:"语文",zhong:"",mo:"",yi:"",er:""},
                    {type:"数学",zhong:"",mo:"",yi:"",er:""},
                    {type:"英语",zhong:"",mo:"",yi:"",er:""},
                    {type:"历史",zhong:"",mo:"",yi:"",er:""},
                    {type:"地理",zhong:"",mo:"",yi:"",er:""},
                    {type:"政治",zhong:"",mo:"",yi:"",er:""},
                    {type:"综合",zhong:"",mo:"",yi:"",er:""},
                    {type:"",zhong:"",mo:"",yi:"",er:""}]
            }else{
                proxy.$message.error(res.data.msg);
            }
        },err=>{
            proxy.$message.error(err);
        });
    }
};
/**
 * 成绩修改时进行 验证成绩合理性
 */
let showAdd=(index,string)=>{
    if(!newScoreList.data[index][string]){
        newScoreList.data[index][string]=''
    }else{
        //输入时成绩进行验证
        var kemu = '';
        if(string == 'zhong'){
            kemu = "期中"
        }else if(string == 'mo'){
            kemu = "期末"
        }else if(string == 'yi'){
            kemu = "一模"
        }else if(string == 'er'){
            kemu = "二模"
        }
    //////////////这一块儿没问题   parseFloat
        if(index == 1){
            if(Number(newScoreList.data[1][string])<Number(newScoreList.data[2][string])+Number(newScoreList.data[3][string])+Number(newScoreList.data[4][string])+Number(newScoreList.data[5][string])+Number(newScoreList.data[6][string])+Number(newScoreList.data[7][string])){
                newScoreList.data[index][string] = '';
                proxy.$message.error(kemu+'成绩分数不合理，请调整！六科成绩之和不得高于总成绩')
            };
        }else if(index == 2 || index == 3 || index == 4 || index == 8){
            // this.newScoreList[0][string] = Number(this.newScoreList[4][string])+Number(this.newScoreList[2][string])+Number(this.newScoreList[3][string])+Number(this.newScoreList[8][string]);
            newScoreList.data[0][string] = Number(newScoreList.data[4][string])+Number(newScoreList.data[2][string])+Number(newScoreList.data[3][string])+Number(newScoreList.data[5][string])+Number(newScoreList.data[6][string])+Number(newScoreList.data[7][string]);
            if(index == 8){
                if(Number(newScoreList.data[5][string])+Number(newScoreList.data[6][string])+Number(newScoreList.data[7][string])>Number(newScoreList.data[8][string])){
                    newScoreList.data[index][string] = '';
                    proxy.$message.error(kemu+'成绩分数不合理，请调整！物理+化学+生物（历史+地理+政治），不能大于综合；')
                };
            }
            
        }else{
            if(isNewYear.value){
                newScoreList.data[9][string] = Number(newScoreList.data[5][string])+Number(newScoreList.data[6][string])+Number(newScoreList.data[7][string])
            }else{
                newScoreList.data[8][string] = Number(newScoreList.data[5][string])+Number(newScoreList.data[6][string])+Number(newScoreList.data[7][string])
            }
            newScoreList.data[0][string] = Number(newScoreList.data[4][string])+Number(newScoreList.data[2][string])+Number(newScoreList.data[3][string])+Number(newScoreList.data[5][string])+Number(newScoreList.data[6][string])+Number(newScoreList.data[7][string]);
        };
        newScoreList.data[index][string] = Number(newScoreList.data[index][string]);
    }
    
    if(newScoreList.data[index][string] != Number(oldScoreList.data[index][string])){
        historyScoreForm.data.scoreList[1][string] = 1
    }
/////////////////////
};
let toloosreport=(row)=> {
    //跳转失利
    isDel.value=true;
    let params = {
        customerId: row.id,
        chooseSubjects: row.subjectNames,
        chooseSubjectsId: row.subjectIds,
        yearly: row.yearly,//判断是否为20年之前、之后
        stuType: row.stuType,//复读，非读复
        studentId: row.studentId,
    }
    let toName;
    if(row.yearly < 2021){
        toName = 'gklossreport';
    }else{
        toName = 'newGklossReport'
    }
    store.commit(`${toName}/setRouteParams`, params);
    router.push({
        name: toName,
        params: params
    })
};
//登顶计划跳转
let toTopPlan=(row)=>{
    isDel.value=true;
    //通过“是否艺考”判断进入哪个登顶计划页面
    
    let params = {
        customerId: row.id,//学生id
        studentId: row.studentId,//学生学号
        studentName: row.allName,//学生姓名
        classId: searchParam.data.id,//班级id
        yearly: row.yearly,//学年
        schoollList: schoollList.data,
        subjectIds: row.subjectIds,//学科
        subjectNames: row.subjectNames, //学科科目
    }
    if(row.isArtExam == 1){//艺考生
        store.commit('artsGovindaplan/setRouteParams', params);
        router.push({
            name: 'artsGovindaplan',
            path: '/artsGovindaplan',
            params: params
        })
    }else{//非艺考生
        let toName;
        if(row.yearly < 2021){
            toName = 'govindaplan';
        }else{
            toName = 'newGovindaplan'
        }
        store.commit(`${toName}/setRouteParams`, params);
        router.push({
            name: toName,
            path: toName,
            params: params
        })
    }
};
// 学情分析
let xueiqngfenxi=(row)=>{
    isDel.value=true;
    let params = {
        classId:searchParam.data.id,//班级id
        yearly:row.yearly,//学年
        customerId:row.id,//学生id
        testId:row.id,
        className:searchParam.data.name,
        allName: row.allName,//学生姓名
    }
    store.commit('xueqingfenxi/setRouteParams', params)
    router.push({
        name:'xueqingfenxi',
        params: params
    })            
};
//错因分析
let errfenxi=(row)=>{
    isDel.value=true;
    let params = {
        classId:searchParam.data.id,//班级id
        yearly:row.yearly,//学年
        customerId:row.id,//学生id
        subjectIds:row.subjectIds,
        subjectNames:row.subjectNames,
        allName:row.allName,//学生姓名
        testId: ''
    }
    store.commit('errfenxi/setRouteParams', params);
    router.push({
        name:'errfenxi',
        params: params
    })  
};
let getKspcList=(yearly)=> {
    let param = new URLSearchParams();
    param.append("paperType", 0);
    param.append("grade", 17);
    // param.append("isTongJi", null);
    param.append("yearly", yearly); //学年
    // param.append("testType", 1); //1大考 2周统练
    //授课地点
    proxy.$post(baseUrl + "/ft/ftchoose/getSchoolTestsOfCondition.do", param)
        .then(
        res => {
            console.log(res.data.data.schTests)
            if (res.data.code == 0) {
                kspcList.data = res.data.data.schTests;
                testScoreParam.data.testId = res.data.data.beforeTestId || "";
                testForm.testId = res.data.data.beforeTestId || '';
            } else {
                proxy.$message.error(res.data.msg);
            }
        },
        err => {
            proxy.$message.error(err);
        }
    );
};
//学情分析考试批次获取
let getKspcListXQ=(yearly)=> {
    let param = new URLSearchParams();
    param.append("paperType", 0);
    param.append("grade", 17);
    param.append("yearly", searchParam.data.yearly); //学年
    // param.append("testType", 1); //1大考 2周统练
    //授课地点
    proxy.$post(baseUrl + "/ft/ftchoose/getSchoolTestsOfCondition.do", param)
        .then(
        res => {
            if (res.data.code == 0) {
                testIdA.value = res.data.data.beforeTestId || "";
            } else {
                proxy.$message.error(res.data.msg);
            }
        },
        err => {
            proxy.$message.error(err);
        }
    );
};
//下载试题
let downloadWord=(row)=>{
    let rows = JSON.parse(JSON.stringify(row));
    testForm={
        testId:'',
        subjectId:'',
        studentId : rows.studentId,
        customerId : rows.id,
    }
    getKspcList(rows.yearly);
    if(testRulesRef.value){
        testRulesRef.value.resetFields();
    }
    downwordVisible.value = true;
    
};
//下载试题 按钮
let confirmDonload=()=>{
    testRulesRef.value.validate((valid) => {
        if(valid){
            let param = new URLSearchParams();
            let exportObj ={responseType: 'blob', timeout: 1000 * 30 * 60};
            param.append("customerId", testForm.customerId||'');
            param.append("testId", testForm.testId||'');
            param.append("subjectId", testForm.subjectId||''); //科目
            param.append("studentId", testForm.studentId||''); //学号
            loading.value=true;
            //下载word
            proxy.$post(baseUrl + "/ft/educationcontroller/downloadRelatedQuestions.do", param, exportObj).then(
                res => {
                    if (res.data.type === 'application/json') {//文件流在错误 的时候转json提示信息
                        let reader = new FileReader();
                        // 处理load事件。该事件在读取操作完成时触发
                        reader.onload = e => {
                            let res = JSON.parse(e.target.result);
                            proxy.$message.error(res.msg); //异常信息抛出
                        };
                        reader.readAsText(res.data);
                    }else{
                        let headerContent = res.headers['content-disposition']; 
                        if(headerContent){
                            let filenameStr = headerContent.split('=')[1];
                            let blobobj = new Blob([res.data],{type:'application/vnd.ms-word'});
                            downFile(blobobj, decodeURI(filenameStr));
                        }
                    } 
                    loading.value = false;
                    downwordVisible.value = false;
                    
                },
                err => {
                    proxy.$message.error(err);
                }
            );
        } else {
            return proxy.$message.error('请填写必填项！');
        }
    }) 
};
//考试报告
let goScoreTestChoose=(row)=>{
    scoreAvgVisible.value = true;
    getKspcList(row.yearly);
    testScoreParam.data.yearly = row.yearly;
    testScoreParam.data.customerId = row.id;
    testScoreParam.data.studentId = row.studentId;
    testScoreParam.data.studentName = row.allName;
    testScoreParam.data.classId = this.searchParam.id;//班级id
    testScoreParam.data. className = this.searchParam.name;
    testScoreParam.data.analysisWd = 'hd';
};
//跳转考试报告(s生成考试报告)
let goScoreCityAvg=()=>{
    if(!testScoreParam.data.testId){
        return proxy.$message.error("考试批次不能为空");
    }
    if(!testScoreParam.data.analysisWd){
        return proxy.$message.error("弱科分析维度不能为空");
    }
    isDel.value=true;

    var parames = new Array();
    parames.push({ name: "studentName", value: testScoreParam.data.studentName});
    parames.push({ name: "customerId", value: testScoreParam.data.customerId});
    parames.push({ name: "studentId", value: testScoreParam.data.studentId});
    parames.push({ name: "classId", value: testScoreParam.data.classId});
    parames.push({ name: "testId", value: testScoreParam.data.testId});
    parames.push({ name: "analysisWd", value: testScoreParam.data.analysisWd});

    if(testScoreParam.data.analysisWd == 'hd'){ //当选择海淀数据维护时，进行判断
        let params = new URLSearchParams();
        params.append("testId",testScoreParam.data.testId);
        proxy.$post(baseUrl+'/ft/pdfReport/chkHdData.do',params).then(res => {
            if (res.data.code !== 0) {
                return proxy.$message.error(res.data.msg);
            }
            if(res.data.data.isHasHdData == 0){ //无海淀数据时
                scoreAvgVisible.value = true;
                return proxy.$message.error("该考试批次当前无海淀数据，请选择【精华百分比】生成考试报告");
            }else{ //有海淀数据时---生成
                scoreAvgVisible.value = false;
                Post(baseUrl+"/ft/pdfReport/gocityavg.do", parames);
            }
        }, err => {
            proxy.$message.error(err);
        });
    }else{
        scoreAvgVisible.value = false;
        Post(baseUrl+"/ft/pdfReport/gocityavg.do", parames);
    }
    return false;

// let url = baseUrl+'/ft/pdfReport/gocityavg.do?studentName='+this.testScoreParam.studentName
// +'&customerId='+this.testScoreParam.customerId+'&studentId='+this.testScoreParam.studentId
// +'&classId='+this.testScoreParam.classId+'&testId='+this.testScoreParam.testId
// +'&analysisWd='+this.testScoreParam.analysisWd;
// console.log(this.$route.params)

// window.open(url);

    // this.$router.push({
    //     name:'studentCityScoreHd',
    //     params:{
    //         classId:this.testScoreParam.classId,//班级id
    //         yearly:this.testScoreParam.yearly,//学年
    //         customerId:this.testScoreParam.customerId,//学生id
    //         studentName:this.testScoreParam.studentName,//学生姓名
    //         studentId:this.testScoreParam.studentId,
    //         className:this.testScoreParam.className,
    //         analysisWd:this.testScoreParam.analysisWd,
    //         testId:this.testScoreParam.testId
    //     }
    // })  
};
let Post=(URL, PARAMTERS)=> {
    //创建form表单
    var temp_form = document.createElement("form");
    temp_form.action = URL;
    //如需打开新窗口，form的target属性要设置为'_blank'
    temp_form.target = "_blank";
    temp_form.method = "post";
    temp_form.style.display = "none";
    //添加参数
    for (var item in PARAMTERS) {
        var opt = document.createElement("textarea");
        opt.name = PARAMTERS[item].name;
        opt.value = PARAMTERS[item].value;
        temp_form.appendChild(opt);
    }
    document.body.appendChild(temp_form);
    isOpenReport.value = false;
    //提交数据
    temp_form.submit();
};
// onMounted(()=>{
    getSessionSearch();
// })
onActivated(()=>{
    // isUseCache为false时才重新刷新获取数据
    // 因为对list使用keep-alive来缓存组件，所以默认是会使用缓存数据的         
    if(route.meta.isUseCache == true){
        dataLists.data = []; // 清空原有数据
        getSessionSearch();
    } 
    // 通过这个控制刷新
    route.meta.isUseCache = false;
})
// onDeactivated(()=>{
//     debugger
//     if(popverRef.value){
//         // this.$refs.popver.$el.getElementsByClassName('el-popper')[0].click()
//         document.querySelector("#app").click();
//     }
// });
onBeforeRouteLeave((to, from ,next)=>{
    if (to.name == 'showStudentLinkPage' || to.name == 'showSixOne' 
        || to.name == 'studentsSchedule' || to.name == 'testSendWord' || to.name == 'studentsType' 
        || to.name == 'xueqingfenxi' || to.name == 'gklossreport' || to.name == 'newGklossReport'
        || to.name == 'govindaplan' || to.name == 'artsGovindaplan' || to.name == 'showTimeManagement'
        || to.name == 'showClassMeetingDetail' || to.name == 'baseInfoModify' || to.name == 'lookprizexq' || to.name == 'tklookprizexq'
        ||to.name=="errfenxi" || to.name=="studentCityScoreHd" || to.name=="stuSchedule" || to.name=="homeworkList") {
        // 根据是否删除操作，进行判断是否需要使用缓存数据
        to.meta.isUseCache = isDel.value; 
        isDel.value=false;
    }   else {
        to.meta.isUseCache = false; 
    }
    next();  
})

// export default {
//     name: 'showClassStudents',
//     components: {inputNumber},
//     data() {
//         return {
//             yearly: 2020,//2020年比较新、旧数据
//             schoollList:[],//高考学校列表
//             oneInfo:{},
//             tableHeight:50 ,
//             searchParam: {},
//             showCourse:false,
//             isDel:false,
//             dataLists: [],
//             kspcList:[],//考试批次
//             testIdA:'', //详情页跳转用的考试批次
//             memWordVisible: false,//背单词设置
//             memWordVisible2: false,//背单词-简单词设置
//             studentTypeVisible: false,//学生类型弹框
//             fenclassVisible:false,//分班成绩弹框
//             fenclassVisible1:false,//分班成绩弹框
//             historyScoreVisible:false,//历史成绩弹窗
//             scoreAvgVisible:false,//生成考试报告弹窗
//             testScoreParam:{
//                 studentName:'',
//                 classId:'',
//                 studentId:'',
//                 customerId:'',
//                 testId:'',
//                 analysisWd:'hd'
//             },
//             studentTypeForm: {//学生类型
//                 stuScore: [],//成绩
//                 stuType: [],//界别
//                 ifReread:[],//是否多次复读
//                 stuLevel: [],//类型
//                 stuTestScore: [],//高考加分
//                 huji: [],//户籍所在区域
//                 xueji: [],//学籍所在区域
//                 baom: [],//报名所在区域
//                 paperType: [],//试卷种类
//                 ifBeiJing: [],//籍贯分类
//                 isOldStudent: [],//全日制老生
//             },
//             pageTypeList: [],//试卷种类
//             areaList: [],//
//             perScorelist:[],//分班成绩
//             customerId:'',//选中学生的id
//             scoreAreaList:[],
//             historyScoreForm:{
//                 studentName:"",
//                 scoreArea:"",
//                 startType:"",
//                 subjectType:"", 
//                 yearly:"",
//                 scoreList:[
//                     {type:"examType",zhong:16,mo:8,yi:4,er:2},//考试批次id
//                     {type:"编辑状态",zhong:0,mo:0,yi:0,er:0},//成绩编辑状态，0未更改，1已修改
//                     {type:"id",zhong:'',mo:'',yi:'',er:''}
//                     // 
//                 ]//综合成绩之和
//             },
//             enWordSettingForm:{
//                 ifWordType:''
//             },
//             isScoreArea:true,
//             theScore:[],
//             //旧数据
//             oldScoreList:[
//                 {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
//                 {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                 {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                 {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                 {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                 {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                 {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                 {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                 {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                 {type:"",zhong:"",mo:"",yi:"",er:""}],
//             newScoreList:[
//                 {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
//                 {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                 {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                 {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                 {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                 {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                 {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                 {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                 {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                 {type:"",zhong:"",mo:"",yi:"",er:""}],
//             loading: false,
//             isChong:false, //是否为密码重置
//             isKai:false, //是否为密码开通
//             isYuan:false, //原密码显示
//             password:'',
//             subjectList: [
//                 {id: 101,name: '语文'},
//                 {id: 102,name: '数学'},
//                 {id: 103,name: '英语'},
//                 {id: 104,name: '物理'},
//                 {id: 105,name: '化学'},
//                 {id: 106,name: '生物'},
//                 {id: 107,name: '历史'},
//                 {id: 108,name: '地理'},
//                 {id: 109,name: '政治'}
//             ],
//             downwordVisible: false,//下载试题
//             testForm: {
//                 testId: '',
//                 subjectId: '',
//             },
//             testRules: {
//                 testId: [{ required: true, message: '请选择考试批次！', trigger: 'change' }],
//                 subjectId: [{ required: true, message: '请选择科目', trigger: 'change' }],
//             },
//             oldPassword:'',
//             ifEnTeacher:'',
//             userInfo:{
//                 subjectId:''
//             }
//         }
        
//     },
//     computed:{
//         isNewYear: function(){//判断该学生的是否是2020年之前的保持不变，新的要隐藏
//             let _this = this;
//             return this.historyScoreForm.yearly< this.yearly;
//         }
//     },
//     created() {
//         this.getSessionSearch();
//         this.getKspcListXQ(this.searchParam.yearly);
//     },
//     beforeRouteLeave (to, from, next) { 
//         if (to.name == 'showStudentLinkPage' || to.name == 'showSixOne' 
//             || to.name == 'studentsSchedule' || to.name == 'testSendWord' || to.name == 'studentsType' 
//             || to.name == 'xueqingfenxi' || to.name == 'gklossreport' || to.name == 'newGklossReport'
//             || to.name == 'govindaplan' || to.name == 'artsGovindaplan' || to.name == 'showTimeManagement'
//             || to.name == 'showClassMeetingDetail' || to.name == 'baseInfoModify' || to.name == 'lookprizexq' || to.name == 'tklookprizexq'
//             ||to.name=="errfenxi" || to.name=="studentCityScoreHd" || to.name=="stuSchedule" || to.name=="homeworkList") {
//             // 根据是否删除操作，进行判断是否需要使用缓存数据
//             to.meta.isUseCache = this.isDel; 
//             this.isDel=false;
//         }   else {
//             to.meta.isUseCache = false; 
//         }
//         next();  
//     },
//     deactivated(){
//         if(this.$refs.popver){
//             // this.$refs.popver.$el.getElementsByClassName('el-popper')[0].click()
//             document.querySelector("#app").click();
//         }
//     },
//     // list组价的activated钩子
//     activated() {
//         // isUseCache为false时才重新刷新获取数据
//         // 因为对list使用keep-alive来缓存组件，所以默认是会使用缓存数据的         
//         if(this.$route.meta.isUseCache == true){
//             this.dataLists = []; // 清空原有数据
//             this.getSessionSearch();
//         } 
//         // 通过这个控制刷新
//         this.$route.meta.isUseCache = false;
//     },
//     mounted() {
//         let self = this;
//         this.$nextTick(function(){ 
//             if(self.$refs.table1){
//                 self.tableHeight =window.innerHeight- self.$refs.table1.$el.offsetTop-50; 
//                 //监听窗口大小变化 
//                 let self_ = self;    
//                 window.onresize=function(){ 
//                     self_.tableHeight =window.innerHeight- self_.$refs.table1.$el.offsetTop-50 
//                 }    
//             }
//         }) 
//         //this.$refs.table.$el.offsetTop：表格距离浏览器的高度 　　
//         //50表示你想要调整的表格距离底部的高度（可以随意调整），因为我们一般 都有放分页组件的，所以需要给它留一个高度　 
//     },
//     methods: {
//         ...mapMutations('showClassStudents',['setSearchParams','setRouteParams']),
//         getSessionSearch(){
//             if(JSON.stringify(this.$route.params)!='{}'){
//                 this.searchParam = this.$route.params;
//             }else{
//                 let search = JSON.parse(window.sessionStorage.getItem("vuex"))
//                 if(JSON.stringify(search.showClassStudents.routeParams)!='{}'){
//                     this.searchParam = search.showClassStudents.routeParams
//                 }
//             }
//             if(!this.searchParam.radio){
//                 this.searchParam.radio = 1;
//             }
//             // this.searchParam = this.$route.params;
            
//             if(this.searchParam.paperType===0 && this.searchParam.grade == 17){
//                 this.showCourse = true;
//             }else{
//                 this.showCourse = false;
//             }
//             this.getDataList();  
//             this.getPageType();   
//             this.getScoreArea();     
//             this.getAreaList();    
//             this.getSchoollList(); 
//             this.getTeacherSub(); 
//         },
//         //获取登录教师科目
//         getTeacherSub(){
//             this.$axios.get(baseUrl+'/ot/ftchoose/getUserInfo.do')
//                 .then(res => {
//                     if(res.data.code==0){  
//                         this.ifEnTeacher = false;
//                         this.userInfo.subjectId = res.data.subjectId
//                         if(this.userInfo.subjectId == 103){
//                             this.ifEnTeacher = true
//                         }
//                     }
//             }, err => {
//                 this.$message.error(err);
//             });
//         },
//         /**
//          * 获取市、县、区
//          */
//         getAreaList(){
//             let param = new URLSearchParams();
//             let _this = this;
//             this.$axios.post( baseUrl + '/ft/ftchoose/getProvinceCityArea.do', param)
//                 .then(res=>{
//                     if(res.data.code == 0){
//                         _this.areaList = res.data.data;
//                     }else{
//                         this.$message.error(res.data.msg);
//                     }
//                 })
//         },
//         /**
//          * 获取历史成绩城区
//          */
//         getScoreArea(){
//             let param = new URLSearchParams();
//             let _this = this;
//             this.$axios.post( baseUrl + '/ft/ftchoose/getCityAreaOfBj.do')
//                 .then(res=>{
//                     if(res.data.code == 0){
//                         _this.scoreAreaList = res.data.data;
//                     }else{
//                         this.$message.error(res.data.msg);
//                     }
//                 })
//         },
//         /**
//          * 试卷种类列表
//          */
//         getPageType(){
//             let param = new URLSearchParams();
//             let _this = this;
//             this.$axios.post( baseUrl + '/ft/ftchoose/getPagetypeList.do', param)
//                 .then(res=>{
//                     if(res.data.code == 0){
//                         _this.pageTypeList = res.data.data;
//                     }else{
//                         this.$message.error(res.data.msg);
//                     }
//                 })
//         },
//         /**
//          * 开通账号
//          */
//         goOpenCRM(){
            
//             // this.searchParam.isPwd=true
//             this.goReset();
//         },
//         /**
//          * 课表重置密码
//          */
//         goReset(){
//             let param = new URLSearchParams();
//             param.append("id", this.searchParam.studentId || '');
//             let _this = this;
//             this.$axios.post(baseUrl + '/ft/educationcontroller/resetPassWord.do', param)
//                 .then(res =>{
//                     if(res.data.code == 0){
//                         _this.getDataList();
//                         if(_this.searchParam.isPwd){
//                             // _this.$message({
//                             //     message: '重置成功，密码为123456',
//                             //     type: 'success'
//                             // });
//                             this.isChong = true;
//                         }else{
//                             // this.$message.success('开通成功，密码为123456');
//                             this.isKai = true
//                         }
//                         this.password = res.data.data
//                         this.isYuan = false;
                        
//                     }else{
//                         _this.$message.error(res.data.msg);
//                     }
//                 }, err =>{
//                     _this.$message.error('服务器错误！')
//                 }
//             )
//         },
//         closeIt(){
//             this.memWordVisible = false;
//             this.isChong = false;
//             this.isKai = false;
//             this.isYuan = false;
//         },
//         closeIt2(){
//             this.memWordVisible2 = false;
//         },
//         getTableData(){
//             this.getDataList();
//         },
//         getDataList(){
//             this.loading = true;
//             let param = new URLSearchParams();
//             if(this.searchParam.id || !isNaN(this.searchParam.id)){
//                 param.append("id", this.searchParam.id);
//             }
//             // if(this.searchParam.radio || !isNaN(this.searchParam.radio)){
//             //     param.append("radio", this.searchParam.radio);
//             // }
//             param.append("flag", 1);
//             let _this = this;
//             this.$axios.post(baseUrl + '/ft/educationcontroller/query_student.do', param)
//                 .then(res =>{
//                     if(res.data.code == 0){
//                         _this.dataLists = res.data.data;
//                     }
//                     _this.loading = false;
//                 }, err =>{
//                     this.$message.error(err);
//                     _this.loading = false;
//                 }
//             )
//         },
//         /**
//          * 学生课表
//          */
//         goSchedule(row, key){
//             this.isDel=true;
//            /*  let params = {
//                 allName: row.allName,//学生姓名
//                 studentId: row.studentId,//学生学号
//                 customerId: row.id,//学生id
//                 classId: this.searchParam.id,//班级id
//             };
//             this.$store.commit('studentsSchedule/setRouteParams', params);
//             this.$router.push({
//                 name: 'studentsSchedule',
//                 path: '/studentsSchedule',
//                 params: params
//             }) */
//             let params ={
//                 yearly: row.yearly,
//                 studentId: row.studentId,
//                 studentName: row.allName,//学生姓名
//                 classId: this.searchParam.id,//班级id
//             }
//             this.$store.commit('stuSchedule/setRouteParams', params);
//             this.$router.push({
//                 name: "stuSchedule",
//                 params: params
//             });
//         },
//         /**
//          * TODO 
//          * 跳转成绩首页
//          */
//         goAchievementHomePage(row){
//             console.log(row)
//             let params ={
//                 customerId: row.id ||'',
//                 yearly: row.yearly || '',
//                 classInfo : 1,
//                 studentId: row.studentId || '',
//                 grade: row.grade || '',
//                 index: true,
//                 paperType: '0',
//                 subjectIds:row.subjectIds || '',
//                 // isArtExam: row.isArtExam || '',
//             }
//             let routeData = this.$router.resolve({ 
//                 name: 'studentHomePage1'
//             });
//             window.open(routeData.href +'?@pageFlag=stu', '_blank');
//         },
//         /**
//          * 6+1跳转
//          */
//         goSixOne(row,){
//             this.isDel=true;
//             let params = {
//                 allName: row.allName,//学生姓名
//                 studentId: row.studentId,//学生学号
//                 customerId: row.id,//学生id
//                 classId: this.searchParam.id,//班级id
//             }
//             this.$store.commit('showSixOne/setRouteParams', params);
//             this.$router.push({
//                 name: 'showSixOne',
//                 path: '/showSixOne',
//                 params: params
//             })
//         },
//         /**
//          * 沟通记录跳转
//          */
//         goConnect(row){
//             this.isDel=true;
//             let params = {
//                 allName: row.allName,//学生姓名
//                 studentId: row.studentId,//学生学号
//                 studentNo: row.id,//学生id
//                 classId: this.searchParam.id,//班级id
//             }
//             this.$store.commit('showStudentLinkPage/setRouteParams', params);
//             this.$router.push({
//                 name: 'showStudentLinkPage',
//                 path: '/showStudentLinkPage',
//                 params: params
//             })
//         },

//         //跳转到成绩与沟通页面
//         goScoreCommit(row){
//             console.log(row)
//             let params ={
//                 customerId: row.id ||'',
//                 key:1,
//                 showPanel:'crm',
//                 ifqrz: row.ifqrz || '',
//                 isLook: true
//             }
//             let routeData = this.$router.resolve({ 
//                 name: 'scoreCommunication'
//             });
//             window.open(routeData.href +'?@pageFlag=talk', '_blank');
//         },
//         /**
//          * 考试寄语跳转
//          */
//         goTestSendWord(row){
//             this.isDel=true;
//             let params = {
//                 allName: row.allName,//学生姓名
//                 studentId: row.studentId,//学生学号
//                 customerId: row.id,//学生id
//                 classId: this.searchParam.id,//班级id
//             }
//             this.$store.commit('testSendWord/setRouteParams', params);
//             this.$router.push({
//                 name: 'testSendWord',
//                 path: '/testSendWord',
//                 params: params
//             })
//         },
//         /**
//          * 学情分析页调整
//          */
//         goXqfx(row){//跳转路径页面
//         let params ={
//                 customerId: row.id ||'',
//                 yearly: row.yearly || '',
//                 classInfo : 1,
//                 studentId: row.studentId || '',
//                 grade: row.grade || '',
//                 index: true,
//                 paperType: '0',
//                 subjectIds:row.subjectIds || '',
//                 testId: this.testIdA ||'',
//                 type: 1
//             }
//             let routeData = this.$router.resolve({ 
//                 name: 'studentHomePage'
//             });
//             window.open(routeData.href +'?@pageFlag=stu', '_blank');
//         },
//         /**
//          * 背单词设置
//          */
//         goReciteWords(row){   
//             this.searchParam.studentId = row.id;
//             this.searchParam.studentName = row.allName;                   
//             this.$set(this.searchParam, 'isPwd', row.password ? true: false);
//             this.memWordVisible = true; 
//             let Base64 = require('js-base64').Base64
//             if(row.password){
//                 this.isYuan = true;
//                 this.oldPassword = Base64.decode(row.password);
//             }
            
//         },
//         // 背单词-简单词设置
//         goEnWordSetting(row){
//             this.memWordVisible2 = true;
//             this.searchParam.studentId = row.id;
//             this.searchParam.studentName = row.allName;
//             if(row.ifWordType){
//                 this.enWordSettingForm.ifWordType = true
//             }else{
//                 this.enWordSettingForm.ifWordType = false
//             }
            
//         },
//         enWordSettingSave(){
//             if(this.enWordSettingForm.ifWordType){
//                 this.enWordSettingForm.ifWordType = 1
//             }else{
//                 this.enWordSettingForm.ifWordType = 0
//             }
//             let param = new URLSearchParams();
//             param.append("id", this.searchParam.studentId || '');
//             param.append("wordType", this.enWordSettingForm.ifWordType);
//             let _this = this;
//             this.$axios.post(baseUrl + '/ft/educationcontroller/save_student_ifWordType.do', param)
//                 .then(res =>{
//                     if(res.data.code == 0){
//                         _this.getDataList();
//                     }else{
//                         _this.$message.error(res.data.msg);
//                     }
//                 }, err =>{
//                     _this.$message.error('服务器错误！')
//                 }
//             )
//             this.memWordVisible2 = false;
//         },
//         /**
//          * 学生类型弹框
//          */
//         goStudentType(row){
//             this.isDel=true;
//             let params = {
//                 allName: row.allName,//学生姓名
//                 studentId: row.studentId,//学生学号
//                 customerId: row.id,//学生id
//                 classId: this.searchParam.id,//班级id
//             }
//             this.$store.commit('studentsType/setRouteParams', params);
//             this.$router.push({
//                 name: 'studentsType',
//                 path: '/studentsType',
//                 params: params
//             })
//         },
//         //学生类型弹框保存
//         studentTypeSave(item){
//             let param = new URLSearchParams();
//             param.append('customerId', this.studentTypeForm.customerId || '');
//             param.append('stuScore', this.getValueArr(this.studentTypeForm.stuScore));
//             param.append('stuType', this.getValueArr(this.studentTypeForm.stuType));
//             param.append('ifReread', this.getValueArr(this.studentTypeForm.ifReread));
//             param.append('stuLevel', this.getValueArr(this.studentTypeForm.stuLevel));
//             param.append('stuTestScore', this.getValueArr(this.studentTypeForm.stuTestScore));
//             param.append('paperType', this.getValueArr(this.studentTypeForm.paperType));
//             param.append('ifBeiJing', this.getValueArr(this.studentTypeForm.ifBeiJing));
//             param.append('isOldStudent', this.getValueArr(this.studentTypeForm.isOldStudent));
//             param.append('huji', this.studentTypeForm.huji);
//             param.append('xueji', this.studentTypeForm.xueji);
//             param.append('baom',this.studentTypeForm.baom);
//             let _this = this;
//             this.$axios.post(baseUrl + '/ft/educationcontroller/saveClassManager.do', param)
//                 .then(res =>{
//                     if(res.data.code == 0){
//                         _this.$message.success('保存成功！');
//                         _this.getDataList();
//                         _this.studentTypeVisible = false;
//                     }else{
//                         _this.$message.error(res.data.msg);
//                     }
//                 }, err =>{
//                     _this.$message.error('服务器错误！')
//                 }
//             )
//             _this.studentTypeVisible = true;
//         },
//         //保存的时候转格式，回显的时候转格式
//         getValueArr(value, info){
//             if(value && value.constructor == Array){//保存的时候，显示为数组，转成值
//                 if(value.length>0 && value.length<=1){
//                     return value[0];
//                 }else if(value.length>1){
//                     let arr = [];
//                     value.forEach(item=>{
//                         if(!isNaN(item)){
//                             arr.push(Number(item));
//                         }
//                     })
//                     return arr;
//                 }else{
//                     return '';
//                 }
//             }else if(value || value===0){//从后台拿回来是值，显示为数组
//                 let val;
//                 let arr = [];
//                 val = String(value).split(',');
//                 if(!isNaN(Number(value[0]))){//数字
//                     val.forEach((item,index)=>{
//                         arr.push(Number(item));
//                     });
//                     val = arr;
//                 }
//                 return val;
//             }else{
//                 return [];
//             }
            
//         },
//         /**
//          * 时间管理
//          */
//         goTimeManagement(row){
//             this.isDel=true;
//             let params = {
//                 allName: row.allName,//学生姓名
//                 studentId: row.studentId,//学生学号
//                 customerId: row.id,//学生id
//                 classId: this.searchParam.id,//班级id
//             }
//             this.$store.commit('showTimeManagement/setRouteParams', params);
//             this.$router.push({
//                 name: 'showTimeManagement',
//                 path: '/showTimeManagement',
//                 params: params
//             })
//         },
//         changgeStuInfo(row){
//             this.isDel=true;
//             // 跳转到基本客户信息修改页面
//             this.$router.push({
//                 name:'baseInfoModify',
//                 path: '/baseInfoModify',
//                 params:{
//                     flag: this.searchParam.flag,//班主任班级管理-学生名单跳转时会带flag参数，flag=0；
//                     customerId: row.id, //学生id
//                     schoollList: this.schoollList
//                 }
//             })
//         },
//         //跳转到班级例会
//         toMeetingDetail(row){
//             this.isDel=true;
//             let params = {
//                 customerId: row.id,
//                 beginDate: '',
//                 endDate:'',
//                 studentName: row.allName,
//             }
//             this.$store.commit('showClassMeetingDetail/setRouteParams', params);
//             this.$router.push({
//                 name: 'showClassMeetingDetail',
//                 params: params
//             })
//         },
//         goContract(row){
//             this.isDel=true;
//             let params = {
//                 customerId: row.id,//学生id
//             }
//             this.$store.commit('contractV/setRouteParams', params);
//             this.$router.push({
//                 name: 'contractV',
//                 path: '/contractV',
//                 params: params
//             })
//         },
//         goHomeworkList(row){
//             this.isDel=true;
//             let params = {
//                 classId:this.searchParam.id,
//                 customerId: row.id,//学生id
//             }
//             this.$store.commit('homeworkList/setRouteParams', params);
//             this.$router.push({
//                 name: 'homeworkList',
//                 path: '/homeworkList',
//                 params: params
//             })
//         },
//         //客户详情
//         studentInfo(row){
//             toCusInfo(row.id);
//             //  this.$axios.post(baseUrl+'/ft/ftchoose/getUserInfo.do').then(res => {
//             //     if(res.data!=null && res.data!='' && res.data.code==0){
//             //         let url='/common/login/returnQrz.do?userRoleId='+res.data.userRole
//             //             +'&gname=客户详情&gurl=/common/customer/customer_index.do?customerId='+row.id
//             //             +'&gparm=;userRole='+res.data.userRole;
//             //         window.open(baseUrl+url);
//             //     }else{
//             //         this.$message.error(res.data.msg);
//             //     }
//             // }, err => {
//             //     this.$message.error(err);
//             // });
//         },
//             /**
//          * 高考学校列表获取
//          */
//         getSchoollList(){     
//             let _this = this;       
//             this.$axios.get(baseUrl +'/ft/ftchoose/get_school.do')
//                 .then(res=>{
//                     if(res.data.code == 0){
//                         _this.schoollList = res.data.data;
//                     }
//                 }, err=>{
//                     this.$message.error("服务器错误！")
//                 })
//         },
//         getfenclass(row, index){
//             if(index==1){
//                 this.fenclassVisible1=true;//点击分班测试成绩
//             }else{
//                 this.fenclassVisible=true;//点击分班成绩
//             }         
//             this.customerId=row.id;//选中学生的id
//             let url = "/ft/ftcustomer/getCustomerTestScoreOfEntrance.do";
//             if(index){
//                 url = "/ft/ftteaching/getPlacementTestScoreInfo.do";
//             }
//             this.$axios.get( baseUrl + url +'?customerId='+row.id)
//                 .then(res=>{
//                     if(res.data.code == 0){
//                             this.perScorelist = res.data.data;
//                     }else{
//                         this.$message.error(res.data.msg);
//                     }
//                 })
            
//         },
//         gofenclasspage(item,index){
//             this.isDel=true;
//             let params = {};
//             let routeName = '';
//             if(index==1){
//                 params={
//                     //跳转到分班测试成绩页面
//                     customerId:item.customerId,
//                     testPaperId:item.testPaperId,
//                     kemu:item.subjectName,
//                     subjectId: item.subjectId,
//                 }
//                 routeName = 'tklookprizexq';
//             }else{
//                 //跳转到分班成绩页面
//                 params = {
//                     customerId:this.customerId,
//                     testPaperId:item.testPaperId,
//                     kemu:item.subjectName
//                 };
//                 routeName = 'lookprizexq';
//             }                
          
//             this.$store.commit(routeName + '/setRouteParams', params);
//             this.$router.push({
//                 name: routeName,
//                 params: params
//             })
//             this.fenclassVisible=false;
//             this.fenclassVisible1=false;
//         },
//         /**
//          * 历史成绩框展现
//          */
//         showScoreArea(row){
//             // 基本信息区域，不用更改
//             this.historyScoreVisible = true;
//             this.historyScoreForm.customerId = row.id;
//             this.historyScoreForm.classId = this.searchParam.id;
//             this.historyScoreForm.studentName = row.allName;
//             this.historyScoreForm.yearly = row.yearly;//学生学年
//             let _this = this;
//             this.$set(this.historyScoreForm,'chooseSubjects', row.subjectNames||'');//该学生选科
//             this.$axios.post(baseUrl+'/ft/ftcustomer/getCustomerHistoryScore.do?customerId='+row.id+'&classId='+this.searchParam.id).then(res=>{
//                 if(res.data.data.subjectType==undefined){
//                     res.data.data.subjectType=''
//                 }
//                 this.historyScoreForm.subjectType = res.data.data.subjectType;//文 理 默认0  0=>文，1=>理
//                 if(_this.isNewYear){//2020学年之前
//                     if(this.historyScoreForm.subjectType==1){
//                         this.newScoreList = [
//                             {type:"",zhong:"",mo:"",yi:"",er:""},
//                             {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                             {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                             {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                             {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                             {type:"物理",zhong:"",mo:"",yi:"",er:""},
//                             {type:"化学",zhong:"",mo:"",yi:"",er:""},
//                             {type:"生物",zhong:"",mo:"",yi:"",er:""},
//                             {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                             {type:"",zhong:"",mo:"",yi:"",er:""}]
//                     }else{
//                         this.newScoreList = [
//                         {type:"",zhong:"",mo:"",yi:"",er:""},
//                         {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                         {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                         {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                         {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                         {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                         {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                         {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                         {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                         {type:"",zhong:"",mo:"",yi:"",er:""}]
//                     }
//                 }else{
//                     this.newScoreList = [
//                         {type:"",zhong:"",mo:"",yi:"",er:""},
//                         {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                         {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                         {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                         {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                         // {type:"物理",zhong:"",mo:"",yi:"",er:""},
//                         // {type:"化学",zhong:"",mo:"",yi:"",er:""},
//                         // {type:"生物",zhong:"",mo:"",yi:"",er:""},
//                         // {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                         // {type:"",zhong:"",mo:"",yi:"",er:""}
//                     ];
//                     let chooseSubjects = _this.historyScoreForm.chooseSubjects.split(',');
//                     chooseSubjects.forEach((item,index)=>{
//                         _this.newScoreList.push({
//                             type: item,
//                             zhong: "",
//                             mo: "",
//                             yi: "",
//                             er: ""
//                         })
//                     })
//                     _this.newScoreList.push({
//                         type: '',
//                         zhong: "",
//                         mo: "",
//                         yi: "",
//                         er: ""
//                     })
//                 }
                
//                 if(res.data.data.cityAreaId!=undefined){
//                     this.historyScoreForm.scoreArea = parseInt(res.data.data.cityAreaId);
//                 }else{
//                     this.historyScoreForm.scoreArea = ""
//                 }
//                 if(res.data.data.startType!=undefined && res.data.data.startType!=null){
//                     this.historyScoreForm.startType = res.data.data.startType||'';
//                 }
//                 this.theScore = res.data.data.scorelist;
//                 var kemu = ["inAll","inCh","inEn","inMa","inO1","inO2","inO3","inOA"]
//                 let scores = res.data.data.scorelist;
                
//                 if(scores.length<=0){
//                     this.isScoreArea = true;
//                 }else{
//                     this.isScoreArea = false;
//                     scores.forEach((item,index,array)=>{
//                     for(var key in this.historyScoreForm.scoreList[0]){
//                         if(this.historyScoreForm.scoreList[0][key] == item.examType){
//                             this.historyScoreForm.scoreList[2][key] = item.id//加入考试的id
//                             kemu.forEach((its,index,array)=>{
//                                 if(item[its]===null&&(item[its]!=='0'||item[its]!==0)){
//                                     item[its]=''
//                                 }
//                                 this.newScoreList[index+1][key] = item[its];
//                                 this.oldScoreList[index+1][key] = item[its];
//                             })
//                         }
//                     }
//                 })
//                 }
                
//             },err=>{
//                 this.$message.error("服务器错误！")
//             })
//         },
//         historyScoreClose(){
//             this.historyScoreVisible= false;
//             this.historyScoreForm.scoreList=[
//                 {type:"examType",zhong:16,mo:8,yi:4,er:2},//考试批次id
//                 {type:"编辑状态",zhong:0,mo:0,yi:0,er:0},//成绩编辑状态，0未更改，1已修改
//                 {type:"id",zhong:'',mo:'',yi:'',er:''}
//             ];
//             this.newScoreList=[{type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
//                     {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                     {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                     {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                     {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                     {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                     {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                     {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                     {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                     {type:"",zhong:"",mo:"",yi:"",er:""}];
//             this.oldScoreList=[{type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
//                     {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                     {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                     {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                     {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                     {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                     {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                     {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                     {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                     {type:"",zhong:"",mo:"",yi:"",er:""}]
//         },
//         //监控文理科变化，展示对应的科目
//         selectWL(){
//             if(this.historyScoreForm.subjectType==1){
//                 this.newScoreList = [
//                     {type:"",zhong:"",mo:"",yi:"",er:""},
//                     {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                     {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                     {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                     {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                     {type:"物理",zhong:"",mo:"",yi:"",er:""},
//                     {type:"化学",zhong:"",mo:"",yi:"",er:""},
//                     {type:"生物",zhong:"",mo:"",yi:"",er:""},
//                     {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                     {type:"",zhong:"",mo:"",yi:"",er:""}]
//             }else{
//                 this.newScoreList = [
//                 {type:"",zhong:"",mo:"",yi:"",er:""},
//                 {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                 {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                 {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                 {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                 {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                 {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                 {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                 {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                 {type:"",zhong:"",mo:"",yi:"",er:""}]
//             }
//         },
//         /**
//          * 历史成绩 内容保存
//          */
//         historyScoreSave(){
//             //提交时在进行验证
//             if(this.isNewYear){
//                 if(this.historyScoreForm.subjectType===0){
//                     if(this.historyScoreForm.scoreArea==''||this.historyScoreForm.scoreArea==null||this.historyScoreForm.scoreArea==undefined){
//                         this.$message.error("历史城区不能为空");
//                         return
//                     }
//                 }else{
//                     if(this.historyScoreForm.scoreArea==''||this.historyScoreForm.scoreArea==null||this.historyScoreForm.scoreArea==undefined||this.historyScoreForm.subjectType==''||this.historyScoreForm.subjectType==null||this.historyScoreForm.subjectType==undefined){
//                         this.$message.error("历史城区与文理科部分不能为空，");
//                         return
//                     }
//                 }
//             }else{
//                 this.historyScoreForm.subjectType = 0;
//                 if(!this.historyScoreForm.scoreArea){
//                     this.$message.error("历史城区不能为空");
//                     return
//                 }
//             }
            
//             let lists = [];
//             for(var key in this.historyScoreForm.scoreList[1]){
//                 if(this.historyScoreForm.scoreList[1][key]==1){
//                     lists.push(key);
//                 };
//             };
//             if(lists.length<=0){
//                 this.$message("当前未对成绩进行修改，请更改后再进行保存");
//                 return;
//             };
//             //   lists.forEach   验证成绩的合理性
//             var isNext =true;
//             lists.forEach((item,index,array)=>{
//                 let kemu = '';
//                 if(item == 'zhong'){
//                     kemu = "期中"
//                 }else if(item == 'mo'){
//                     kemu = "期末"
//                 }else if(item == 'yi'){
//                     kemu = "一模"
//                 }else if(item == 'er'){
//                     kemu = "二模"
//                 }

//                 if(Number(this.newScoreList[1][item])<Number(this.newScoreList[2][item])+Number(this.newScoreList[3][item])+Number(this.newScoreList[4][item])+Number(this.newScoreList[5][item])+Number(this.newScoreList[6][item])+Number(this.newScoreList[7][item])){
//                     this.$message.error(kemu+'成绩分数不合理，请调整！六科成绩之和不得高于总成绩')
//                     isNext = false;
//                     return isNext;
//                 };
//                 if(Number(this.newScoreList[5][item])+Number(this.newScoreList[6][item])+Number(this.newScoreList[7][item])>Number(this.newScoreList[8][item])){
//                     this.$message.error(kemu+'成绩分数不合理，请调整！物理+化学+生物（历史+地理+政治）不能大于综合；')
//                     isNext = false;
//                     return isNext;
//                 }
//             });
//             if(isNext){
//                 if(this.historyScoreForm.startType==''||this.historyScoreForm.startType==null||this.historyScoreForm.startType==undefined){
//                     this.historyScoreForm.startType='';
//                 }
//                 if(this.historyScoreForm.scoreList[3]==null||this.historyScoreForm.scoreList[3]==undefined){
//                     this.newScoreList.forEach((item,index,array)=>{
//                         this.historyScoreForm.scoreList.push(item);
//                     })
//                 }
//                 var scoreForm = JSON.stringify(this.historyScoreForm);
//                 let param = new URLSearchParams();
//                 param.append("scoreForm",scoreForm);
//                 this.$axios.post(baseUrl+'/ft/ftcustomer/saveCustomerExaminationScore.do',param).then(res=>{
//                     if(res.data.code==0){
//                         this.$message.success('历史成绩保存成功');
//                         this.historyScoreVisible=false;
//                         for(var key in this.historyScoreForm){
//                             if(key == 'scoreList'){
//                                 this.historyScoreForm.scoreList=[
//                                     {type:"examType",zhong:16,mo:8,yi:4,er:2},//考试批次id
//                                     {type:"编辑状态",zhong:0,mo:0,yi:0,er:0},//成绩编辑状态，0未更改，1已修改
//                                     {type:"id",zhong:'',mo:'',yi:'',er:''}
//                                 ];
//                             }else{
//                                 this.historyScoreForm[key]=''
//                             }
//                         }
//                         this.newScoreList=[
//                             {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
//                             {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                             {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                             {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                             {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                             {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                             {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                             {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                             {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                             {type:"",zhong:"",mo:"",yi:"",er:""}];
//                         this.oldScoreList=[
//                             {type:"",zhong:"",mo:"",yi:"",er:""},//主课成绩之和
//                             {type:"总分",zhong:"",mo:"",yi:"",er:""},
//                             {type:"语文",zhong:"",mo:"",yi:"",er:""},
//                             {type:"数学",zhong:"",mo:"",yi:"",er:""},
//                             {type:"英语",zhong:"",mo:"",yi:"",er:""},
//                             {type:"历史",zhong:"",mo:"",yi:"",er:""},
//                             {type:"地理",zhong:"",mo:"",yi:"",er:""},
//                             {type:"政治",zhong:"",mo:"",yi:"",er:""},
//                             {type:"综合",zhong:"",mo:"",yi:"",er:""},
//                             {type:"",zhong:"",mo:"",yi:"",er:""}]
//                     }else{
//                         this.$message.error(res.data.msg);
//                     }
//                 },err=>{
//                     this.$message.error(err);
//                 });
//             }
//         },
//         /**
//          * 成绩修改时进行 验证成绩合理性
//          */
//         showAdd(index,string){
//             if(this.newScoreList[index][string]===''||this.newScoreList[index][string]==null || this.newScoreList[index][string]==undefined){
//                 this.newScoreList[index][string]=''
//             }else{
//                 //输入时成绩进行验证
//                 var kemu = '';
//                 if(string == 'zhong'){
//                     kemu = "期中"
//                 }else if(string == 'mo'){
//                     kemu = "期末"
//                 }else if(string == 'yi'){
//                     kemu = "一模"
//                 }else if(string == 'er'){
//                     kemu = "二模"
//                 }
//             //////////////这一块儿没问题   parseFloat
//                 if(index == 1){
//                     if(Number(this.newScoreList[1][string])<Number(this.newScoreList[2][string])+Number(this.newScoreList[3][string])+Number(this.newScoreList[4][string])+Number(this.newScoreList[5][string])+Number(this.newScoreList[6][string])+Number(this.newScoreList[7][string])){
//                         this.newScoreList[index][string] = '';
//                         this.$message.error(kemu+'成绩分数不合理，请调整！六科成绩之和不得高于总成绩')
//                     };
//                 }else if(index == 2 || index == 3 || index == 4 || index == 8){
//                     // this.newScoreList[0][string] = Number(this.newScoreList[4][string])+Number(this.newScoreList[2][string])+Number(this.newScoreList[3][string])+Number(this.newScoreList[8][string]);
//                     this.newScoreList[0][string] = Number(this.newScoreList[4][string])+Number(this.newScoreList[2][string])+Number(this.newScoreList[3][string])+Number(this.newScoreList[5][string])+Number(this.newScoreList[6][string])+Number(this.newScoreList[7][string]);
//                     if(index == 8){
//                         if(Number(this.newScoreList[5][string])+Number(this.newScoreList[6][string])+Number(this.newScoreList[7][string])>Number(this.newScoreList[8][string])){
//                             this.newScoreList[index][string] = '';
//                             this.$message.error(kemu+'成绩分数不合理，请调整！物理+化学+生物（历史+地理+政治），不能大于综合；')
//                         };
//                     }
                    
//                 }else{
//                     if(this.isNewYear){
//                         this.newScoreList[9][string] = Number(this.newScoreList[5][string])+Number(this.newScoreList[6][string])+Number(this.newScoreList[7][string])
//                     }else{
//                         this.newScoreList[8][string] = Number(this.newScoreList[5][string])+Number(this.newScoreList[6][string])+Number(this.newScoreList[7][string])
//                     }
//                     this.newScoreList[0][string] = Number(this.newScoreList[4][string])+Number(this.newScoreList[2][string])+Number(this.newScoreList[3][string])+Number(this.newScoreList[5][string])+Number(this.newScoreList[6][string])+Number(this.newScoreList[7][string]);
//                 };
//                 this.newScoreList[index][string] = Number(this.newScoreList[index][string]);
//             }
            
//             if(this.newScoreList[index][string] != Number(this.oldScoreList[index][string])){
//                 this.historyScoreForm.scoreList[1][string] = 1
//             }
// /////////////////////
//         },
//         toloosreport(row) {
//             //跳转失利
//             this.isDel=true;
//             let params = {
//                 customerId: row.id,
//                 chooseSubjects: row.subjectNames,
//                 chooseSubjectsId: row.subjectIds,
//                 yearly: row.yearly,//判断是否为20年之前、之后
//                 stuType: row.stuType,//复读，非读复
//                 studentId: row.studentId,
//             }
//             let toName;
//             if(row.yearly < 2021){
//                 toName = 'gklossreport';
//             }else{
//                 toName = 'newGklossReport'
//             }
//             this.$store.commit(`${toName}/setRouteParams`, params);
//             this.$router.push({
//                 name: toName,
//                 params: params
//             })
//         },
//         //登顶计划跳转
//         toTopPlan(row){
//             this.isDel=true;
//             //通过“是否艺考”判断进入哪个登顶计划页面
            
//             let params = {
//                 customerId: row.id,//学生id
//                 studentId: row.studentId,//学生学号
//                 studentName: row.allName,//学生姓名
//                 classId: this.searchParam.id,//班级id
//                 yearly: row.yearly,//学年
//                 schoollList: this.schoollList,
//                 subjectIds: row.subjectIds,//学科
//                 subjectNames: row.subjectNames, //学科科目
//             }
//             if(row.isArtExam == 1){//艺考生
//                 this.$store.commit('artsGovindaplan/setRouteParams', params);
//                 this.$router.push({
//                     name: 'artsGovindaplan',
//                     path: '/artsGovindaplan',
//                     params: params
//                 })
//             }else{//非艺考生
//                 let toName;
//                 if(row.yearly < 2021){
//                     toName = 'govindaplan';
//                 }else{
//                     toName = 'newGovindaplan'
//                 }
//                 this.$store.commit(`${toName}/setRouteParams`, params);
//                 this.$router.push({
//                     name: toName,
//                     path: toName,
//                     params: params
//                 })
//             }
//         },
//         // 学情分析
//         xueiqngfenxi(row){
//             this.isDel=true;
//             let params = {
//                 classId:this.searchParam.id,//班级id
//                 yearly:row.yearly,//学年
//                 customerId:row.id,//学生id
//                 testId:row.id,
//                 className:this.searchParam.name,
//                 allName: row.allName,//学生姓名
//             }
//             this.$store.commit('xueqingfenxi/setRouteParams', params)
//             this.$router.push({
//                 name:'xueqingfenxi',
//                 params: params
//             })            
//         },
//         //错因分析
//         errfenxi(row){
//             this.isDel=true;
//             let params = {
//                 classId:this.searchParam.id,//班级id
//                 yearly:row.yearly,//学年
//                 customerId:row.id,//学生id
//                 subjectIds:row.subjectIds,
//                 subjectNames:row.subjectNames,
//                 allName:row.allName,//学生姓名
//                 testId: ''
//             }
//             this.$store.commit('errfenxi/setRouteParams', params);
//             this.$router.push({
//                 name:'errfenxi',
//                 params: params
//             })  
//         },
//         getKspcList(yearly) {
//             let param = new URLSearchParams();
//             param.append("paperType", 0);
//             param.append("grade", 17);
//             // param.append("isTongJi", null);
//             param.append("yearly", yearly); //学年
//             // param.append("testType", 1); //1大考 2周统练
//             //授课地点
//             this.$axios
//                 .post(baseUrl + "/ft/ftchoose/getSchoolTestsOfCondition.do", param)
//                 .then(
//                 res => {
//                     console.log(res.data.data.schTests)
//                     if (res.data.code == 0) {
//                         this.kspcList = res.data.data.schTests;
//                         this.testScoreParam.testId = res.data.data.beforeTestId || "";
//                         this.testForm.testId = res.data.data.beforeTestId || '';
//                     } else {
//                         this.$message.error(res.data.msg);
//                     }
//                 },
//                 err => {
//                     this.$message.error(err);
//                 }
//             );
//         },
//         //学情分析考试批次获取
//         getKspcListXQ(yearly) {
//             let param = new URLSearchParams();
//             param.append("paperType", 0);
//             param.append("grade", 17);
//             param.append("yearly", this.searchParam.yearly); //学年
//             // param.append("testType", 1); //1大考 2周统练
//             //授课地点
//             this.$axios
//                 .post(baseUrl + "/ft/ftchoose/getSchoolTestsOfCondition.do", param)
//                 .then(
//                 res => {
//                     if (res.data.code == 0) {
//                     this.testIdA = res.data.data.beforeTestId || "";
//                     } else {
//                     this.$message.error(res.data.msg);
//                     }
//                 },
//                 err => {
//                     this.$message.error(err);
//                 }
//             );
//         },
//         //下载试题
//         downloadWord(row){
//             let rows = JSON.parse(JSON.stringify(row));
//             this.testForm={
//                 testId:'',
//                 subjectId:'',
//                 studentId : rows.studentId,
//                 customerId : rows.id,
//             }
//             this.getKspcList(rows.yearly);
//             if(this.$refs['testRules']){
//                 this.$refs['testRules'].resetFields();
//             }
//             this.downwordVisible = true;
          
//         },
//         //下载试题 按钮
//         confirmDonload(){
//             let _this = this;
//             this.$refs['testRules'].validate((valid) => {
//                 if(valid){
//                     let param = new URLSearchParams();
//                     let exportObj ={responseType: 'blob', timeout: 1000 * 30 * 60};
//                     param.append("customerId", this.testForm.customerId||'');
//                     param.append("testId", this.testForm.testId||'');
//                     param.append("subjectId", this.testForm.subjectId||''); //科目
//                     param.append("studentId", this.testForm.studentId||''); //学号
//                     this.loading=true;
//                     //下载word
//                     this.$axios.post(baseUrl + "/ft/educationcontroller/downloadRelatedQuestions.do", param, exportObj).then(
//                         res => {
//                             if (res.data.type === 'application/json') {//文件流在错误 的时候转json提示信息
//                                 let reader = new FileReader();
//                                 // 处理load事件。该事件在读取操作完成时触发
//                                 reader.onload = e => {
//                                     let res = JSON.parse(e.target.result);
//                                     _this.$message.error(res.msg); //异常信息抛出
//                                 };
//                                 reader.readAsText(res.data);
//                             }else{
//                                 let headerContent = res.headers['content-disposition']; 
//                                 if(headerContent){
//                                     let filenameStr = headerContent.split('=')[1];
//                                     let blobobj = new Blob([res.data],{type:'application/vnd.ms-word'});
//                                     downFile(blobobj, decodeURI(filenameStr));
//                                 }
//                             } 
//                             _this.loading = false;
//                             _this.downwordVisible = false;
                           
//                         },
//                         err => {
//                             this.$message.error(err);
//                         }
//                     );
//                 } else {
//                     _this.$message.error('请填写必填项！');
//                     return;
//                 }
//             }) 
//         },
//         //考试报告
//         goScoreTestChoose(row){
//             this.scoreAvgVisible = true;
//             this.getKspcList(row.yearly);
//             this.testScoreParam.yearly = row.yearly;
//             this.testScoreParam.customerId = row.id;
//             this.testScoreParam.studentId = row.studentId;
//             this.testScoreParam.studentName = row.allName;
//             this.testScoreParam.classId = this.searchParam.id;//班级id
//             this.testScoreParam. className = this.searchParam.name;
//             this.testScoreParam.analysisWd = 'hd';
//         },
//         //跳转考试报告(s生成考试报告)
//         goScoreCityAvg(){
//             if(!this.testScoreParam.testId){
//                 this.$message.error("考试批次不能为空");
//                 return;
//             }
//             if(!this.testScoreParam.analysisWd){
//                 this.$message.error("弱科分析维度不能为空");
//                 return;
//             }
//             this.isDel=true;

//             let _this = this;
//             var parames = new Array();
//             parames.push({ name: "studentName", value: this.testScoreParam.studentName});
//             parames.push({ name: "customerId", value: this.testScoreParam.customerId});
//             parames.push({ name: "studentId", value: this.testScoreParam.studentId});
//             parames.push({ name: "classId", value: this.testScoreParam.classId});
//             parames.push({ name: "testId", value: this.testScoreParam.testId});
//             parames.push({ name: "analysisWd", value: this.testScoreParam.analysisWd});

//             if(this.testScoreParam.analysisWd == 'hd'){ //当选择海淀数据维护时，进行判断
//                 let params = new URLSearchParams();
//                 params.append("testId",this.testScoreParam.testId);
//                 this.$axios.post(baseUrl+'/ft/pdfReport/chkHdData.do',params).then(res => {
//                     if (res.data.code !== 0) {
//                         _this.$message.error(res.data.msg);
//                         return false;
//                     }
//                     if(res.data.data.isHasHdData == 0){ //无海淀数据时
//                         this.scoreAvgVisible = true;
//                         _this.$message.error("该考试批次当前无海淀数据，请选择【精华百分比】生成考试报告");
//                         return false;
//                     }else{ //有海淀数据时---生成
//                         this.scoreAvgVisible = false;
//                         _this.Post(baseUrl+"/ft/pdfReport/gocityavg.do", parames);
//                     }
//                 }, err => {
//                     this.$message.error(err);
//                 });
//             }else{
//                 this.scoreAvgVisible = false;
//                 _this.Post(baseUrl+"/ft/pdfReport/gocityavg.do", parames);
//             }
//             return false;

//         // let url = baseUrl+'/ft/pdfReport/gocityavg.do?studentName='+this.testScoreParam.studentName
//         // +'&customerId='+this.testScoreParam.customerId+'&studentId='+this.testScoreParam.studentId
//         // +'&classId='+this.testScoreParam.classId+'&testId='+this.testScoreParam.testId
//         // +'&analysisWd='+this.testScoreParam.analysisWd;
//         // console.log(this.$route.params)

//         // window.open(url);

//             // this.$router.push({
//             //     name:'studentCityScoreHd',
//             //     params:{
//             //         classId:this.testScoreParam.classId,//班级id
//             //         yearly:this.testScoreParam.yearly,//学年
//             //         customerId:this.testScoreParam.customerId,//学生id
//             //         studentName:this.testScoreParam.studentName,//学生姓名
//             //         studentId:this.testScoreParam.studentId,
//             //         className:this.testScoreParam.className,
//             //         analysisWd:this.testScoreParam.analysisWd,
//             //         testId:this.testScoreParam.testId
//             //     }
//             // })  
//         },
//         Post(URL, PARAMTERS) {
//             //创建form表单
//             var temp_form = document.createElement("form");
//             temp_form.action = URL;
//             //如需打开新窗口，form的target属性要设置为'_blank'
//             temp_form.target = "_blank";
//             temp_form.method = "post";
//             temp_form.style.display = "none";
//             //添加参数
//             for (var item in PARAMTERS) {
//                 var opt = document.createElement("textarea");
//                 opt.name = PARAMTERS[item].name;
//                 opt.value = PARAMTERS[item].value;
//                 temp_form.appendChild(opt);
//             }
//             document.body.appendChild(temp_form);
//             this.isOpenReport = false;
//             //提交数据
//             temp_form.submit();
//         },
//     }
// }
            
</script>
<style scoped>
    .stu-header{
        min-width: 900px;
    }
    .form-title{
        margin-left: 20px;
    }
    .table{
        font-size: 14px;
        margin-top: 20px;
    }
    .percon{
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }
    .percon>p{
        width: 50%;
        text-align: center;
        font-size: 16px;
        color: #409EFF;
        cursor: pointer;
    }
    .percon>p>span{
        display: inline-block;
    }
    .writeInput{
        width: 100%;
    }
    .areaLis{
        display: inline-block;
        width: 80%;
        margin: 3px;
    }
    .searchbt{
        text-align: center;
        /* margin-bottom: 10px; */
        margin-left: 40px;
    }
    .el-dialog-div{
        height: 320px;
        overflow-y: auto;
    }
    .el-dialog-divH{
        overflow-y: auto;
    }
    .words-table{
        display: inline-block;
        width: 100%;
        /* height: 32px; */
        margin: 0;
        padding: 0;
        text-align: center;
    }
    .show-class-stu /deep/ input[type="number"]::-webkit-outer-spin-button,
    .show-class-stu /deep/ input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }
    input[type="number"] {
        -moz-appearance: textfield;
    }
</style>
